added exception to scp
This commit is contained in:
parent
c6439c6899
commit
fbf1e87b39
@ -198,8 +198,10 @@ def copy_local_file_to_lxc(lxc: LXC, path: Path, destination: str):
|
|||||||
Path to the destination in the LXC
|
Path to the destination in the LXC
|
||||||
"""
|
"""
|
||||||
|
|
||||||
proxmox_utils.run_command_locally(command=f"scp -B {str(path)} {lxc.get_ssh_string()}:{destination}",
|
command = proxmox_utils.run_command_locally(command=f"scp -B {str(path)} {lxc.get_ssh_string()}:{destination}",
|
||||||
return_status_code=True)
|
return_status_code=True)
|
||||||
|
if command.returncode != 0:
|
||||||
|
raise Exception(f"Unable to copy file {str(path)} to LXC {lxc.get_id()} at {destination}, probably SSH key issue")
|
||||||
|
|
||||||
|
|
||||||
def copy_local_folder_to_lxc(lxc: LXC, path: Path, destination: str):
|
def copy_local_folder_to_lxc(lxc: LXC, path: Path, destination: str):
|
||||||
@ -215,8 +217,10 @@ def copy_local_folder_to_lxc(lxc: LXC, path: Path, destination: str):
|
|||||||
Path to the destination in the LXC
|
Path to the destination in the LXC
|
||||||
"""
|
"""
|
||||||
|
|
||||||
proxmox_utils.run_command_locally(command=f"scp -B -r {str(path)} {lxc.get_ssh_string()}:{destination}",
|
command = proxmox_utils.run_command_locally(command=f"scp -B -r {str(path)} {lxc.get_ssh_string()}:{destination}",
|
||||||
return_status_code=True)
|
return_status_code=True)
|
||||||
|
if command.returncode != 0:
|
||||||
|
raise Exception(f"Unable to copy file {str(path)} to LXC {lxc.get_id()} at {destination}, probably SSH key issue")
|
||||||
|
|
||||||
|
|
||||||
def run_docker_command(lxc: LXC, container: str, command: str):
|
def run_docker_command(lxc: LXC, container: str, command: str):
|
||||||
|
Loading…
Reference in New Issue
Block a user