Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit35a333d

Browse files
author
v.shepard
committed
PBCKP-152 test multihost - 4
1 parent221ddb8 commit35a333d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎testgres/os_ops.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def connect(self):
4545
withself.ssh_connect()asssh:
4646
returnssh
4747

48-
defexec_command(self,cmd,wait_exit=False,verbose=False):
48+
defexec_command(self,cmd,wait_exit=False,verbose=False,expect_error=False):
4949
ifisinstance(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+
ifexpect_error:
71+
raiseException(result,error)
7072
ifexit_status!=0or'error'inerror.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
returnself.read(filename).splitlines()
109111

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

114116
defkill(self,pid,signal):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp