Show installer command in debug log

This commit is contained in:
Twangboy 2022-11-17 08:16:42 -07:00 committed by Megan Wilhite
parent bd2c180753
commit 2e467c16e8

View file

@ -1770,6 +1770,8 @@ def install(name=None, refresh=False, pkgs=None, **kwargs):
# Check Use Scheduler Option
if pkginfo[version_num].get("use_scheduler", False):
# Create Scheduled Task
log.debug("PKG : cmd: %s /s /c %s", cmd_shell, arguments)
log.debug("PKG : pwd: %s", cache_path)
__salt__["task.create_task"](
name="update-salt-software",
user_name="System",
@ -1827,6 +1829,8 @@ def install(name=None, refresh=False, pkgs=None, **kwargs):
ret[pkg_name] = {"install status": "failed"}
else:
# Launch the command
log.debug("PKG : cmd: %s /s /c %s", cmd_shell, arguments)
log.debug("PKG : pwd: %s", cache_path)
result = __salt__["cmd.run_all"](
'"{}" /s /c "{}"'.format(cmd_shell, arguments),
cache_path,
@ -1834,6 +1838,7 @@ def install(name=None, refresh=False, pkgs=None, **kwargs):
python_shell=False,
redirect_stderr=True,
)
log.debug("PKG : retcode: %s", result["retcode"])
if not result["retcode"]:
ret[pkg_name] = {"install status": "success"}
changed.append(pkg_name)