Don't sudo when the ssh username is root

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2022-12-01 07:24:25 +00:00 committed by Megan Wilhite
parent 2aa4042c77
commit a5523069bf

View file

@ -967,7 +967,7 @@ class VM:
env["OUTPUT_COLUMNS"] = str(self.ctx.console.width)
env["GITHUB_ACTIONS_PIPELINE"] = "1"
self.write_and_upload_dot_env(env)
if self.is_windows is False:
if self.is_windows is False and self.config.ssh_username != "root":
sudo = True
else:
sudo = False