From: velandy Date: Mon, 23 Jan 2017 23:52:51 +0000 (+0000) Subject: Bug 166 - Fixed NS stuck in VNF init phase forever when IP address is not assigned... X-Git-Tag: v1.1.0~16 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=08effcd8c95f689ac84ffc40878980cf9e9f8497;p=osm%2FSO.git Bug 166 - Fixed NS stuck in VNF init phase forever when IP address is not assigned to the VNF Signed-off-by: velandy --- 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"