mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
commit
f795b60537
3 changed files with 5 additions and 6 deletions
|
@ -131,7 +131,10 @@ def check_file_list_cache(opts, form, list_cache, w_lock):
|
|||
if os.path.exists(list_cache):
|
||||
# calculate filelist age is possible
|
||||
cache_stat = os.stat(list_cache)
|
||||
age = time.time() - cache_stat.st_mtime
|
||||
# st_time can have a greater precision than time, removing
|
||||
# float precision makes sure age will never be a negative
|
||||
# number.
|
||||
age = int(time.time()) - int(cache_stat.st_mtime)
|
||||
else:
|
||||
# if filelist does not exists yet, mark it as expired
|
||||
age = opts.get('fileserver_list_cache_time', 20) + 1
|
||||
|
|
|
@ -693,14 +693,12 @@ def refresh_db(**kwargs):
|
|||
|
||||
# Cache repo-ng locally
|
||||
log.info('Fetching *.sls files from {0}'.format(repo_details.winrepo_source_dir))
|
||||
ret = __salt__['cp.cache_dir'](
|
||||
__salt__['cp.cache_dir'](
|
||||
path=repo_details.winrepo_source_dir,
|
||||
saltenv=saltenv,
|
||||
include_pat='*.sls',
|
||||
exclude_pat=r'E@\/\..*?\/' # Exclude all hidden directories (.git)
|
||||
)
|
||||
log.debug("refresh_db - Return from cache_dir %s", repr(ret))
|
||||
|
||||
return genrepo(saltenv=saltenv, verbose=verbose, failhard=failhard)
|
||||
|
||||
|
||||
|
|
|
@ -75,8 +75,6 @@ class WinPKGTest(ModuleCase):
|
|||
locale: en_US
|
||||
reboot: False
|
||||
'''))
|
||||
fp_.flush()
|
||||
os.fsync(fp_.fileno())
|
||||
# now check if curl is also in cache and repo query
|
||||
pkgs.append('curl')
|
||||
for pkg in pkgs:
|
||||
|
|
Loading…
Add table
Reference in a new issue