diff options
author | dongwenjuan <dong.wenjuan@zte.com.cn> | 2018-08-22 09:48:58 +0800 |
---|---|---|
committer | dongwenjuan <dong.wenjuan@zte.com.cn> | 2018-08-23 17:44:49 +0800 |
commit | da25598a6a31abe0579ffed12d1719e5ff75f9a7 (patch) | |
tree | 7b51732d5864ea936d907b85a8595bd7c4e6142f /doctor_tests/installer/base.py | |
parent | f9e1e3b1ae4be80bc2dc61d9c4213c81c091ea72 (diff) |
bugfix: add doctor datasource in congress
Change-Id: I465fd6c59daf99dd543488a15819dab78e8cdd7b
Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'doctor_tests/installer/base.py')
-rw-r--r-- | doctor_tests/installer/base.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/doctor_tests/installer/base.py b/doctor_tests/installer/base.py index 4eed3f29..953b36d9 100644 --- a/doctor_tests/installer/base.py +++ b/doctor_tests/installer/base.py @@ -118,16 +118,18 @@ class BaseInstaller(object): % (output, command, self.conf.installer.type)) return output - def _run_apply_patches(self, client, restart_cmd, script_name): + def _run_apply_patches(self, client, restart_cmd, script_names): installer_dir = os.path.dirname(os.path.realpath(__file__)) - script_abs_path = '{0}/{1}/{2}'.format(installer_dir, - 'common', script_name) - client.scp(script_abs_path, script_name) - cmd = 'sudo python %s' % script_name - ret, output = client.ssh(cmd) - if ret: - raise Exception('Do the command in controller' - ' node failed, ret=%s, cmd=%s, output=%s' - % (ret, cmd, output)) - client.ssh(restart_cmd) + if isinstance(script_names, list): + for script_name in script_names: + script_abs_path = '{0}/{1}/{2}'.format(installer_dir, + 'common', script_name) + client.scp(script_abs_path, script_name) + cmd = 'sudo python3 %s' % script_name + ret, output = client.ssh(cmd) + if ret: + raise Exception('Do the command in controller' + ' node failed, ret=%s, cmd=%s, output=%s' + % (ret, cmd, output)) + client.ssh(restart_cmd) |