mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +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
1 changed files with 18 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue