Fix issues raised by linter (#738)

* fix linter issue with quotes

* fix issue with common.vm cmdlet not recognized
This commit is contained in:
Elliot Chernofsky
2025-12-17 17:37:24 -05:00
committed by GitHub
parent c812a32e70
commit a6aba8b2a7
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -229,7 +229,10 @@ def build_vm(vm_name, exported_vm_name, snapshots, date, custom_config, do_not_i
notice_file_name = snapshot.get("legal_notice", None)
if notice_file_name:
notice_file_path = rf"C:\Users\{GUEST_USERNAME}\Desktop\{notice_file_name}"
set_notice_cmd = f"Import-Module $env:VM_COMMON_DIR\\vm.common\\vm.common.psm1; VM-Set-Legal-Notice (Get-Content '{notice_file_path}' -Raw)"
set_notice_cmd = (
f"Import-Module $env:VM_COMMON_DIR\\vm.common\\vm.common.psm1; "
f"VM-Set-Legal-Notice (Get-Content '{notice_file_path}' -Raw)"
)
run_command(vm_uuid, set_notice_cmd)
# Perform clean up: run 'VM-Clean-Up' excluding configured files and folders
+1 -1
View File
@@ -53,7 +53,7 @@ def __run_vboxmanage(cmd, real_time=False):
# which can cause conflicts with external binaries like VBoxManage.
# We create a clean environment for the subprocess to use the system's libraries.
env = os.environ.copy()
if getattr(sys, 'frozen', False) and "LD_LIBRARY_PATH" in env:
if getattr(sys, "frozen", False) and "LD_LIBRARY_PATH" in env:
# 'sys.frozen' is True when running from a PyInstaller executable.
# We can either remove the variable or, more safely, restore the original
# one if PyInstaller saved it. PyInstaller often saves it as LD_LIBRARY_PATH_ORIG.