Skip to content

Commit

Permalink
remove quote and use int for vmid
Browse files Browse the repository at this point in the history
  • Loading branch information
mietzen committed Dec 18, 2024
1 parent c2d0f47 commit 5c93df2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/connection/pct_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
vmid:
description:
- LXC Container ID
type: str
type: int
default: proxmox_vmid
vars:
- name: proxmox_vmid
Expand Down Expand Up @@ -527,7 +527,7 @@ def _connect_uncached(self) -> paramiko.SSHClient:
def exec_command(self, cmd: str, in_data: bytes | None = None, sudoable: bool = True) -> tuple[int, bytes, bytes]:
''' execute a command inside the proxmox container '''
cmd = ['/usr/sbin/pct', 'exec',
self.get_option('vmid'), '--', quote(cmd)]
str(self.get_option('vmid')), '--', cmd]
if self.get_option('remote_user') != 'root':
cmd = [become_command()] + cmd
return self._ssh_exec_command(' '.join(cmd), in_data=in_data, sudoable=sudoable)
Expand All @@ -540,7 +540,7 @@ def put_file(self, in_path: str, out_path: str) -> None:
self._ssh_exec_command(f'mkdir -p {temp_dir}')
self._ssh_put_file(in_path, temp_file_path)
cmd = ['/usr/sbin/pct', 'push',
self.get_option('vmid'), temp_file_path, quote(out_path)]
str(self.get_option('vmid')), temp_file_path, out_path]
if self.get_option('remote_user') != 'root':
cmd = [become_command()] + cmd
self._ssh_exec_command(' '.join(cmd))
Expand All @@ -557,7 +557,7 @@ def fetch_file(self, in_path: str, out_path: str) -> None:
try:
self._ssh_exec_command(f'mkdir -p {temp_dir}')
cmd = ['/usr/sbin/pct', 'pull',
self.get_option('vmid'), quote(in_path), temp_file_path]
str(self.get_option('vmid')), in_path, temp_file_path]
if self.get_option('remote_user') != 'root':
cmd = [become_command()] + cmd
self._ssh_exec_command(' '.join(cmd))
Expand Down

0 comments on commit 5c93df2

Please sign in to comment.