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

Commit44c5fac

Browse files
Merge pull request#169 from dmitry-lipetsk/D20241224_003--ssh_command_line
Ssh command line in RemoteOperations::execute is corrected
2 parents3224e21 +3ca3ff7 commit44c5fac

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎testgres/node.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,10 +1125,7 @@ def _psql(
11251125

11261126
# select query source
11271127
ifquery:
1128-
ifself.os_ops.remote:
1129-
psql_params.extend(("-c",'"{}"'.format(query)))
1130-
else:
1131-
psql_params.extend(("-c",query))
1128+
psql_params.extend(("-c",query))
11321129
eliffilename:
11331130
psql_params.extend(("-f",filename))
11341131
else:

‎testgres/operations/remote_ops.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ def exec_command(self, cmd, wait_exit=False, verbose=False, expect_error=False,
8080
ifisinstance(cmd,str):
8181
ssh_cmd= ['ssh',self.ssh_dest]+self.ssh_args+ [cmd]
8282
elifisinstance(cmd,list):
83-
ssh_cmd= ['ssh',self.ssh_dest]+self.ssh_args+cmd
83+
ssh_cmd= ['ssh',self.ssh_dest]+self.ssh_args+ [subprocess.list2cmdline(cmd)]
84+
else:
85+
raiseValueError("Invalid 'cmd' argument type - {0}".format(type(cmd).__name__))
86+
8487
process=subprocess.Popen(ssh_cmd,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
8588
assertnot (processisNone)
8689
ifget_process:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp