We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent22c4763 commit7fd2f07Copy full SHA for 7fd2f07
testgres/operations/remote_ops.py
@@ -78,14 +78,17 @@ def exec_command(self, cmd, wait_exit=False, verbose=False, expect_error=False,
78
79
assertinput_preparedisNoneor (type(input_prepared)==bytes)# noqa: E721
80
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)]
+iftype(cmd)==str:# noqa: E721
+cmd_s=cmd
+eliftype(cmd)==list:# noqa: E721
+cmd_s=subprocess.list2cmdline(cmd)
86
else:
87
raiseValueError("Invalid 'cmd' argument type - {0}".format(type(cmd).__name__))
88
+asserttype(cmd_s)==str# noqa: E721
89
+
90
+ssh_cmd= ['ssh',self.ssh_dest]+self.ssh_args+ [cmd_s]
91
92
process=subprocess.Popen(ssh_cmd,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
93
assertnot (processisNone)
94
ifget_process: