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

RemoteOperations::exec_command updated#185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
RemoteOperations::exec_command updated
- Exact enumeration of supported 'cmd' types- Refactoring
  • Loading branch information
@dmitry-lipetsk
dmitry-lipetsk committedFeb 20, 2025
commitf5fe166eec93c2b727b4ee0145eecdf77d9b38d6
13 changes: 8 additions & 5 deletionstestgres/operations/remote_ops.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -78,14 +78,17 @@ def exec_command(self, cmd, wait_exit=False, verbose=False, expect_error=False,

assert input_prepared is None or (type(input_prepared) == bytes) # noqa: E721

ssh_cmd = []
if isinstance(cmd, str):
ssh_cmd = ['ssh', self.ssh_dest] + self.ssh_args + [cmd]
elif isinstance(cmd, list):
ssh_cmd = ['ssh', self.ssh_dest] + self.ssh_args + [subprocess.list2cmdline(cmd)]
if type(cmd) == str: # noqa: E721
cmd_s = cmd
elif type(cmd) == list: # noqa: E721
cmd_s = subprocess.list2cmdline(cmd)
else:
raise ValueError("Invalid 'cmd' argument type - {0}".format(type(cmd).__name__))

assert type(cmd_s) == str # noqa: E721

ssh_cmd = ['ssh', self.ssh_dest] + self.ssh_args + [cmd_s]

process = subprocess.Popen(ssh_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
assert not (process is None)
if get_process:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp