mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #38156 from terminalmage/fix-windows-refresh
Remove rtag when windows minion refreshes early in state
This commit is contained in:
commit
31a157d902
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user