From 08effcd8c95f689ac84ffc40878980cf9e9f8497 Mon Sep 17 00:00:00 2001 From: velandy Date: Mon, 23 Jan 2017 23:52:51 +0000 Subject: [PATCH] Bug 166 - Fixed NS stuck in VNF init phase forever when IP address is not assigned to the VNF Signed-off-by: velandy --- .../rift/tasklets/rwnsmtasklet/openmano_nsm.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py index e009ba3f..7133ea43 100644 --- a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py +++ b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py @@ -630,6 +630,13 @@ class OpenmanoNsr(object): yield from self._publisher.publish_vnfr(None, vnfr_msg) return + if (time.time() - start_time) > OpenmanoNsr.TIMEOUT_SECS: + self._log.error("NSR timed out before reaching running state") + self._state = OpenmanoNSRecordState.FAILED + vnfr_msg.operational_status = "failed" + yield from self._publisher.publish_vnfr(None, vnfr_msg) + return + if all_vms_active(vnf_status): vnf_ip_address = get_vnf_ip_address(vnf_status) vnf_mac_address = get_vnf_mac_address(vnf_status) @@ -671,12 +678,6 @@ class OpenmanoNsr(object): yield from self._publisher.publish_vnfr(None, vnfr_msg) active_vnfs.append(vnfr) - if (time.time() - start_time) > OpenmanoNsr.TIMEOUT_SECS: - self._log.error("NSR timed out before reaching running state") - self._state = OpenmanoNSRecordState.FAILED - vnfr_msg.operational_status = "failed" - yield from self._publisher.publish_vnfr(None, vnfr_msg) - return except Exception as e: vnfr_msg.operational_status = "failed" -- 2.25.1