Merge pull request #35520 from morganwillcock/dism-return-codes

Check for all success return codes in win_dism state
This commit is contained in:
Mike Place 2016-08-20 11:35:01 +09:00 committed by GitHub
commit edefff51d4

View file

@ -83,7 +83,7 @@ def capability_installed(name,
status = __salt__['dism.add_capability'](
name, source, limit_access, image, restart)
if status['retcode'] != 0:
if status['retcode'] not in [0, 1641, 3010]:
ret['comment'] = 'Failed to install {0}: {1}'\
.format(name, status['stdout'])
ret['result'] = False
@ -139,7 +139,7 @@ def capability_removed(name, image=None, restart=False):
# Remove the capability
status = __salt__['dism.remove_capability'](name, image, restart)
if status['retcode'] != 0:
if status['retcode'] not in [0, 1641, 3010]:
ret['comment'] = 'Failed to remove {0}: {1}' \
.format(name, status['stdout'])
ret['result'] = False
@ -210,7 +210,7 @@ def feature_installed(name,
status = __salt__['dism.add_feature'](
name, package, source, limit_access, enable_parent, image, restart)
if status['retcode'] != 0:
if status['retcode'] not in [0, 1641, 3010]:
ret['comment'] = 'Failed to install {0}: {1}' \
.format(name, status['stdout'])
ret['result'] = False
@ -270,7 +270,7 @@ def feature_removed(name, remove_payload=False, image=None, restart=False):
status = __salt__['dism.remove_feature'](
name, remove_payload, image, restart)
if status['retcode'] != 0:
if status['retcode'] not in [0, 1641, 3010]:
ret['comment'] = 'Failed to remove {0}: {1}' \
.format(name, status['stdout'])
ret['result'] = False
@ -338,7 +338,7 @@ def package_installed(name,
status = __salt__['dism.add_package'](
name, ignore_check, prevent_pending, image, restart)
if status['retcode'] != 0:
if status['retcode'] not in [0, 1641, 3010]:
ret['comment'] = 'Failed to install {0}: {1}' \
.format(name, status['stdout'])
ret['result'] = False
@ -407,7 +407,7 @@ def package_removed(name, image=None, restart=False):
# Remove the package
status = __salt__['dism.remove_package'](name, image, restart)
if status['retcode'] != 0:
if status['retcode'] not in [0, 1641, 3010]:
ret['comment'] = 'Failed to remove {0}: {1}' \
.format(name, status['stdout'])
ret['result'] = False