Don't forward agent on CI

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2022-10-31 06:33:18 +00:00 committed by Megan Wilhite
parent aa96d5d6a3
commit eaf511ddfb

View file

@ -428,6 +428,10 @@ class VM:
def write_ssh_config(self):
if self.ssh_config_file.exists():
return
if os.environ.get("CI") is not None:
forward_agent = "no"
else:
forward_agent = "yes"
ssh_config = textwrap.dedent(
f"""\
Host {self.name}
@ -437,7 +441,7 @@ class VM:
LogLevel=FATAL
StrictHostKeyChecking=no
UserKnownHostsFile=/dev/null
ForwardAgent=yes
ForwardAgent={forward_agent}
"""
)
self.ssh_config_file.write_text(ssh_config)
@ -994,7 +998,6 @@ class VM:
assert ssh
_ssh_command_args = [
ssh,
"-a",
"-F",
str(self.ssh_config_file.relative_to(REPO_ROOT)),
]