If the IP address that is on file doesn't match, write the file again

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-09-20 10:20:59 +01:00 committed by Pedro Algarvio
parent 2ccf2401dc
commit d35ff0a9a0

View file

@ -821,7 +821,12 @@ class VM:
def write_ssh_config(self):
if self.ssh_config_file.exists():
return
if (
f"Hostname {self.instance.private_ip_address}"
in self.ssh_config_file.read_text()
):
# If what's on config matches, then we're good
return
if os.environ.get("CI") is not None:
forward_agent = "no"
else: