Merge pull request #38156 from terminalmage/fix-windows-refresh

Remove rtag when windows minion refreshes early in state
This commit is contained in:
Mike Place 2016-12-09 14:15:01 -07:00 committed by GitHub
commit 31a157d902

View File

@ -75,6 +75,7 @@ state module
# Import python libs
from __future__ import absolute_import
import errno
import logging
import os
import re
@ -1277,6 +1278,15 @@ def installed(
if salt.utils.is_windows():
was_refreshed = was_refreshed or refresh
if was_refreshed:
try:
os.remove(rtag)
except OSError as exc:
if exc.errno != errno.ENOENT:
log.error(
'Failed to remove refresh tag %s: %s',
rtag, exc.__str__()
)
kwargs.pop('refresh')
refresh = False
@ -1498,7 +1508,14 @@ def installed(
if not hold_ret[x]['result']]
if os.path.isfile(rtag) and was_refreshed:
os.remove(rtag)
try:
os.remove(rtag)
except OSError as exc:
if exc.errno != errno.ENOENT:
log.error(
'Failed to remove refresh tag %s: %s',
rtag, exc.__str__()
)
if to_unpurge:
changes['purge_desired'] = __salt__['lowpkg.unpurge'](*to_unpurge)