Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksei Stepanov <penguinolog@gmail.com>
  • Loading branch information
penguinolog committed Oct 22, 2019
1 parent bfc56a9 commit c7e144d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exec_helpers/_ssh_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def _prepare_command(self, cmd: str, chroot_path: typing.Optional[str] = None) -
if not self.sudo_mode:
return super()._prepare_command(cmd=cmd, chroot_path=chroot_path)
if any((chroot_path, self._chroot_path)):
target_path: str = shlex.quote(chroot_path if chroot_path else self._chroot_path)
target_path: str = shlex.quote(chroot_path if chroot_path else self._chroot_path) # type: ignore
return f'chroot {target_path} sudo sh -c "eval {shlex.quote(cmd)}"'
return f'sudo -S sh -c "eval {shlex.quote(cmd)}"'

Expand Down
2 changes: 1 addition & 1 deletion exec_helpers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _prepare_command(self, cmd: str, chroot_path: typing.Optional[str] = None) -
:returns: final command, includes chroot, if required
"""
if any((chroot_path, self._chroot_path)):
target_path: str = shlex.quote(chroot_path if chroot_path else self._chroot_path)
target_path: str = shlex.quote(chroot_path if chroot_path else self._chroot_path) # type: ignore
return f'chroot {target_path} sh -c "eval {shlex.quote(cmd)}"'
return cmd

Expand Down

0 comments on commit c7e144d

Please sign in to comment.