Skip to content
Open
Changes from all 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
7 changes: 6 additions & 1 deletion pyinfra/connectors/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,19 @@ def put_file(
logger.error("File upload error: {0}".format(output.stderr))
return False

rm_arguments = arguments.copy()
# _chdir is the only one of the global arguments that could require _sudo to succeed
# and _sudo isn't present in arguments as removed above
rm_arguments.pop("_chdir", False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appears unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was me getting interrupted I think 😒


# Delete the temporary file now that we've successfully copied it
command = StringCommand("rm", "-f", temp_file)

status, output = self.run_shell_command(
command,
print_output=print_output,
print_input=print_input,
**arguments,
**rm_arguments,
)

if status is False:
Expand Down