From 1a0727a912d1d502608d67e43bdcb81c72c55a7f Mon Sep 17 00:00:00 2001 From: twangboy Date: Wed, 20 Sep 2023 12:23:04 -0600 Subject: [PATCH] Quote the start command --- tests/support/pkg.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/support/pkg.py b/tests/support/pkg.py index 1eff0807868..0b32402a118 100644 --- a/tests/support/pkg.py +++ b/tests/support/pkg.py @@ -445,10 +445,9 @@ class SaltPkgInstall: if pkg.endswith("exe"): # Install the package log.debug("Installing: %s", str(pkg)) - # ret = self.proc.run("start", "/wait", f"\"{str(pkg)} /start-minion=0 /S\"") batch_file = pathlib.Path(pkg).parent / "install_nsis.cmd" - batch_content = f"start /wait {str(pkg)} /start-minion=0 /S" - with salt.utils.files.fopen(batch_file, "w") as fp: + batch_content = f'start "" /wait "{str(pkg)}" /start-minion=0 /S' + with open(batch_file, "w") as fp: fp.write(batch_content) # Now run the batch file ret = self.proc.run("cmd.exe", "/c", str(batch_file)) @@ -814,10 +813,9 @@ class SaltPkgInstall: ret = self.proc.run("cmd.exe", "/c", str(batch_file)) self._check_retcode(ret) else: - # ret = self.proc.run("start", "/wait", f"\"{pkg_path} /start-minion=0 /S\"") batch_file = pkg_path.parent / "install_nsis.cmd" - batch_content = f"start /wait {str(pkg_path)} /start-minion=0 /S" - with salt.utils.files.fopen(batch_file, "w") as fp: + batch_content = f'start "" /wait "{str(pkg_path)}" /start-minion=0 /S' + with open(batch_file, "w") as fp: fp.write(batch_content) # Now run the batch file ret = self.proc.run("cmd.exe", "/c", str(batch_file))