diff options
author | Tomi Juvonen <tomi.juvonen@nokia.com> | 2018-09-28 12:15:43 +0300 |
---|---|---|
committer | Tomi Juvonen <tomi.juvonen@nokia.com> | 2018-10-29 12:52:57 +0000 |
commit | 9e012b87f560fe13f8cc63a21321a4f0c2efa1b0 (patch) | |
tree | 5f70c3f4309d13a9fc217e404e2680ac847220cb /doctor_tests/installer/base.py | |
parent | a7517dda9ede8bedadcbcedf7a46187268977d3a (diff) |
Support Apex with services in containers
Upstream apex now works in containers, so if used, it needs to be supported
JIRA: DOCTOR-130
Change-Id: I3d73a1699e4fee53b001f043f55d0eeefa7bfb7b
Signed-off-by: Tomi Juvonen <tomi.juvonen@nokia.com>
(cherry picked from commit a6575910a137f8932e294f66c9da3194ad937691)
Diffstat (limited to 'doctor_tests/installer/base.py')
-rw-r--r-- | doctor_tests/installer/base.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/doctor_tests/installer/base.py b/doctor_tests/installer/base.py index 953b36d9..30435931 100644 --- a/doctor_tests/installer/base.py +++ b/doctor_tests/installer/base.py @@ -26,6 +26,7 @@ class BaseInstaller(object): self.conf = conf self.log = log self.servers = list() + self.use_containers = False @abc.abstractproperty def node_user_name(self): @@ -118,7 +119,20 @@ class BaseInstaller(object): % (output, command, self.conf.installer.type)) return output - def _run_apply_patches(self, client, restart_cmd, script_names): + def _check_cmd_remote(self, client, command): + self.log.info('Check command=%s return in %s installer......' + % (command, self.conf.installer.type)) + + ret, output = client.ssh(command, raise_enabled=False) + self.log.info('return %s' % ret) + if ret == 0: + ret = True + else: + ret = False + return ret + + def _run_apply_patches(self, client, restart_cmd, script_names, + python='python3'): installer_dir = os.path.dirname(os.path.realpath(__file__)) if isinstance(script_names, list): @@ -126,10 +140,10 @@ class BaseInstaller(object): 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 + cmd = 'sudo %s %s' % (python, script_name) ret, output = client.ssh(cmd) if ret: - raise Exception('Do the command in controller' + raise Exception('Do the command in remote' ' node failed, ret=%s, cmd=%s, output=%s' % (ret, cmd, output)) client.ssh(restart_cmd) |