Bug 166 - Fixed NS stuck in VNF init phase forever when IP address is not assigned... 06/1006/1
authorvelandy <rajesh.velandy@riftio.com>
Mon, 23 Jan 2017 23:52:51 +0000 (23:52 +0000)
committervelandy <rajesh.velandy@riftio.com>
Mon, 23 Jan 2017 23:55:05 +0000 (23:55 +0000)
Signed-off-by: velandy <rajesh.velandy@riftio.com>
rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py

index e009ba3..7133ea4 100644 (file)
@@ -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"