Skip to content

Commit

Permalink
Fix additional linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrubake committed Feb 9, 2024
1 parent 546509f commit e059162
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lxc_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def wrapped(self, *args, **kwargs):
# 0 = success
# 1-254 = remote command return code
# 255 = failure from the ssh command itself
except (AnsibleControlPersistBrokenPipeError) as e:
except AnsibleControlPersistBrokenPipeError as e:
# Retry one more time because of the ControlPersist
# broken pipe (see #16731)
display.vvv("RETRYING BECAUSE OF CONTROLPERSIST BROKEN PIPE")
Expand All @@ -478,7 +478,7 @@ def wrapped(self, *args, **kwargs):
"Failed to connect to the host via ssh: %s"
% to_native(return_tuple[2])
)
except (AnsibleConnectionFailure, Exception) as e:
except AnsibleConnectionFailure, Exception as e:
if attempt == remaining_tries - 1:
raise
else:
Expand Down Expand Up @@ -540,15 +540,15 @@ def _set_command_prefix(self):

def _set_version(self):
# Check for 'pct' first in case the host is a proxmox server
if self._exec_command("type -p lxc", None, False)[0] == 0:
if self._exec_command("type lxc", None, False)[0] == 0:
self.lxc_version = "pct"
display.vvv("PCT")
# LXC v1 uses 'lxc-info', 'lxc-attach' and so on
elif self._exec_command("type -p lxc-info", None, False)[0] == 0:
elif self._exec_command("type lxc-info", None, False)[0] == 0:
self.lxc_version = "lxc-v1"
display.vvv("LXC v1")
# LXC v2 uses just 'lxc'
elif self._exec_command("type -p lxc", None, False)[0] == 0:
elif self._exec_command("type lxc", None, False)[0] == 0:
self.lxc_version = "lxc-v2"
display.vvv("LXC v2")
else:
Expand Down Expand Up @@ -1385,7 +1385,7 @@ def exec_command(self, cmd, in_data=None, sudoable=False):
ssh_executable = self.get_option("ssh_executable")
h = self.container_name
if self.lxc_version == "pct":
lxc_cmd = "pct exec %s -- %s" % (pipes.quote(h), cmd)
lxc_cmd = "pct exec %s -- %s" % (pipes.quote(h), cmd)
elif self.lxc_version == "lxc-v2":
lxc_cmd = "%slxc exec %s --mode=non-interactive -- /bin/sh -c %s" % (
self.systemd_run_prefix,
Expand Down

0 comments on commit e059162

Please sign in to comment.