Merge pull request 'API: add keyfile arg' (#1881) from hsjobeki/clan-core:hsjobeki-hw into main

This commit is contained in:
clan-bot
2024-08-13 17:35:29 +00:00

View File

@@ -92,6 +92,7 @@ def generate_machine_hardware_info(
machine_name: str, machine_name: str,
hostname: str, hostname: str,
password: str | None = None, password: str | None = None,
keyfile: str | None = None,
force: bool | None = False, force: bool | None = False,
) -> HardwareInfo: ) -> HardwareInfo:
""" """
@@ -108,6 +109,7 @@ def generate_machine_hardware_info(
[ [
*(["sshpass", "-p", f"{password}"] if password else []), *(["sshpass", "-p", f"{password}"] if password else []),
"ssh", "ssh",
*(["-i", f"{keyfile}"] if keyfile else []),
# Disable strict host key checking # Disable strict host key checking
"-o StrictHostKeyChecking=no", "-o StrictHostKeyChecking=no",
# Disable known hosts file # Disable known hosts file