Skip to content

Commit 35a333d

Browse files
author
v.shepard
committed
PBCKP-152 test multihost - 4
1 parent 221ddb8 commit 35a333d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

testgres/os_ops.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def connect(self):
4545
with self.ssh_connect() as ssh:
4646
return ssh
4747

48-
def exec_command(self, cmd, wait_exit=False, verbose=False):
48+
def exec_command(self, cmd, wait_exit=False, verbose=False, expect_error=False):
4949
if isinstance(cmd, list):
5050
cmd = ' '.join(cmd)
5151
log.debug(f"os_ops.exec_command: `{cmd}`; remote={self.remote}")
@@ -67,6 +67,8 @@ def exec_command(self, cmd, wait_exit=False, verbose=False):
6767
result = process.stdout
6868
error = process.stderr
6969

70+
if expect_error:
71+
raise Exception(result, error)
7072
if exit_status != 0 or 'error' in error.lower():
7173
log.error(f"Problem in executing command: `{cmd}`\nerror: {error}\nexit_code: {exit_status}")
7274
exit(1)
@@ -108,7 +110,7 @@ def readlines(self, filename):
108110
return self.read(filename).splitlines()
109111

110112
def get_name(self):
111-
cmd = 'python -c "import os; print(os.name)"'
113+
cmd = 'python3 -c "import os; print(os.name)"'
112114
return self.exec_command(cmd).strip()
113115

114116
def kill(self, pid, signal):

0 commit comments

Comments
 (0)