Handle the exception for running the profiler
[doctor.git] / doctor_tests / scenario / fault_management.py
index 869311b..5216aa8 100644 (file)
@@ -40,7 +40,7 @@ sleep 1
 
 class FaultManagement(object):
 
-    def __init__(self, conf, installer, user, log):
+    def __init__(self, conf, installer, user, log, transport_url):
         self.conf = conf
         self.log = log
         self.user = user
@@ -55,7 +55,7 @@ class FaultManagement(object):
         self.network = Network(self.conf, log)
         self.instance = Instance(self.conf, log)
         self.alarm = Alarm(self.conf, log)
-        self.inspector = get_inspector(self.conf, log)
+        self.inspector = get_inspector(self.conf, log, transport_url)
         self.monitor = get_monitor(self.conf,
                                    self.inspector.get_inspector_url(),
                                    log)
@@ -209,6 +209,10 @@ class FaultManagement(object):
         detected = self.monitor.detected_time
         notified = self.consumer.notified_time
 
+        if None in [vmdown, hostdown, detected, notified]:
+            self.log.info('one of the time for profiler is None, return')
+            return
+
         # TODO(yujunz) check the actual delay to verify time sync status
         # expected ~1s delay from $trigger to $linkdown
         relative_start = linkdown