fix the username to login undercloud in Apex 79/63979/2
authordongwenjuan <dong.wenjuan@zte.com.cn>
Thu, 25 Oct 2018 03:23:58 +0000 (11:23 +0800)
committerdongwenjuan <dong.wenjuan@zte.com.cn>
Thu, 25 Oct 2018 03:28:56 +0000 (11:28 +0800)
Change-Id: I6d5325166db642b3481a0327f518ec821a8ab378
Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
doctor_tests/installer/__init__.py
doctor_tests/installer/apex.py
doctor_tests/installer/daisy.py
doctor_tests/scenario/fault_management.py

index ee44018..2b9ad83 100644 (file)
@@ -20,10 +20,6 @@ OPTS = [
     cfg.StrOpt('ip',
                default=os.environ.get('INSTALLER_IP', '127.0.0.1'),
                help='the ip of installer'),
-    cfg.StrOpt('username',
-               default='root',
-               help='the user name for login installer server',
-               required=True),
     cfg.StrOpt('key_file',
                default=os.environ.get('SSH_KEY', None),
                help='the key for user to login installer server',
index 694adb8..31850a7 100644 (file)
@@ -16,6 +16,7 @@ from doctor_tests.installer.base import BaseInstaller
 
 class ApexInstaller(BaseInstaller):
     node_user_name = 'heat-admin'
+    installer_username = 'stack'
     cm_set_script = 'set_config.py'
     nc_set_compute_script = 'set_compute_config.py'
     cg_set_script = 'set_congress.py'
@@ -26,7 +27,7 @@ class ApexInstaller(BaseInstaller):
     def __init__(self, conf, log):
         super(ApexInstaller, self).__init__(conf, log)
         self.client = SSHClient(self.conf.installer.ip,
-                                self.conf.installer.username,
+                                self.installer_username,
                                 key_filename=self.conf.installer.key_file,
                                 look_for_keys=True)
         self.key_file = None
index 52ccb7c..e4499d9 100644 (file)
@@ -12,11 +12,12 @@ from doctor_tests.installer.base import BaseInstaller
 
 class DaisyInstaller(BaseInstaller):
     node_user_name = 'root'
+    installer_username = 'root'
 
     def __init__(self, conf, log):
         super(DaisyInstaller, self).__init__(conf, log)
         self.client = SSHClient(self.conf.installer.ip,
-                                self.conf.installer.username,
+                                self.installer_username,
                                 password='r00tme')
         self.key_file = None
         self.controllers = list()
index ee3bf5f..869311b 100644 (file)
@@ -180,9 +180,12 @@ class FaultManagement(object):
         notification_time = \
             self.consumer.notified_time - \
             self.monitor.detected_time
+
+        self.log.info('doctor fault management notification_time=%s'
+                      % notification_time)
+
         if notification_time < 1 and notification_time > 0:
-            self.log.info('doctor fault management test successfully,'
-                          'notification_time=%s' % notification_time)
+            self.log.info('doctor fault management test successfully')
         else:
             if self.conf.profiler_type:
                 self.log.info('run doctor fault management profile.......')