Skip to content

Commit

Permalink
guest-tools/win: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tu Dinh committed Oct 31, 2024
1 parent aacbed8 commit 1d52a23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions tests/guest-tools/win/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ def run_command_powershell(vm: VM, program: str, args: List[str]):
Backslash-safe.
"""
# ProgressPreference is needed to suppress any clixml progress output as it's not filtered away from stdout by default, and we're grabbing stdout
cmd = f"$ProgressPreference = 'SilentlyContinue'; Write-Output (Start-Process -Wait -PassThru {program} -ArgumentList '{" ".join(args)}').ExitCode"
args = " ".join(args)
# ProgressPreference is needed to suppress any cli\xml progress output as it's not filtered away from stdout by default, and we're grabbing stdout
cmd = f"$ProgressPreference = 'SilentlyContinue'; Write-Output (Start-Process -Wait -PassThru {program} -ArgumentList '{args}').ExitCode"
return int(
vm.ssh(
[
Expand All @@ -90,7 +91,7 @@ def start_background_powershell(vm: VM, cmd: str):
Backslash-safe.
"""
async_cmd = f"\\'powershell.exe -encodedcommand {encode_ps_command(cmd)}\\'"
async_cmd = f"\\'powershell.exe -noprofile -noninteractive -encodedcommand {encode_ps_command(cmd)}\\'"
vm.ssh(
[
"powershell.exe",
Expand Down
2 changes: 1 addition & 1 deletion tests/guest-tools/win/test_guest_tools_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def running_windows_vm(imported_vm: VM) -> VM:
logging.info("Wait for VM IP")
vm.ip = try_get_and_store_ip_serial(vm, timeout=10)
break
except:
except Exception:
pass
if not vm.ip:
raise Exception("Cannot find VM IP")
Expand Down

0 comments on commit 1d52a23

Please sign in to comment.