mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
win_pkg: report failure for failed launch of Scheduled Task
If the Scheduled Task fails to launch, log this and report the failed status. Don't check for success as the Task Scheduler doesn't give return codes for actions it ran, and only the minion upgrade should be using this (so successful installation or removal would never be reported anyway).
This commit is contained in:
parent
e0978220f7
commit
108f9470f2
1 changed files with 8 additions and 2 deletions
|
@ -698,7 +698,10 @@ def install(name=None, refresh=False, pkgs=None, saltenv='base', **kwargs):
|
|||
ac_only=False,
|
||||
stop_if_on_batteries=False)
|
||||
# Run Scheduled Task
|
||||
__salt__['task.run_wait'](name='update-salt-software')
|
||||
if not __salt__['task.run_wait'](name='update-salt-software'):
|
||||
log.error('Failed to install {0}'.format(pkg_name))
|
||||
log.error('Scheduled Task failed to run')
|
||||
ret[pkg_name] = {'install status': 'failed'}
|
||||
else:
|
||||
# Build the install command
|
||||
cmd = []
|
||||
|
@ -959,7 +962,10 @@ def remove(name=None, pkgs=None, version=None, **kwargs):
|
|||
ac_only=False,
|
||||
stop_if_on_batteries=False)
|
||||
# Run Scheduled Task
|
||||
__salt__['task.run_wait'](name='update-salt-software')
|
||||
if not __salt__['task.run_wait'](name='update-salt-software'):
|
||||
log.error('Failed to remove {0}'.format(target))
|
||||
log.error('Scheduled Task failed to run')
|
||||
ret[target] = {'uninstall status': 'failed'}
|
||||
else:
|
||||
# Build the install command
|
||||
cmd = []
|
||||
|
|
Loading…
Add table
Reference in a new issue