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

Commit7fd2f07

Browse files
RemoteOperations::exec_command updated (#185)
- Exact enumeration of supported 'cmd' types- Refactoring
1 parent22c4763 commit7fd2f07

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

‎testgres/operations/remote_ops.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,17 @@ def exec_command(self, cmd, wait_exit=False, verbose=False, expect_error=False,
7878

7979
assertinput_preparedisNoneor (type(input_prepared)==bytes)# noqa: E721
8080

81-
ssh_cmd= []
82-
ifisinstance(cmd,str):
83-
ssh_cmd= ['ssh',self.ssh_dest]+self.ssh_args+ [cmd]
84-
elifisinstance(cmd,list):
85-
ssh_cmd= ['ssh',self.ssh_dest]+self.ssh_args+ [subprocess.list2cmdline(cmd)]
81+
iftype(cmd)==str:# noqa: E721
82+
cmd_s=cmd
83+
eliftype(cmd)==list:# noqa: E721
84+
cmd_s=subprocess.list2cmdline(cmd)
8685
else:
8786
raiseValueError("Invalid 'cmd' argument type - {0}".format(type(cmd).__name__))
8887

88+
asserttype(cmd_s)==str# noqa: E721
89+
90+
ssh_cmd= ['ssh',self.ssh_dest]+self.ssh_args+ [cmd_s]
91+
8992
process=subprocess.Popen(ssh_cmd,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
9093
assertnot (processisNone)
9194
ifget_process:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp