mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Fix OSError when roots file hash hasn't been built
When the fileserver updates, if no files have been served up then there will be no hash file. Silently handle the exception to keep it out of the log.
This commit is contained in:
parent
89056038a0
commit
46d58dc9ae
@ -75,11 +75,20 @@ def serve_file(load, fnd):
|
||||
ret['data'] = data
|
||||
return ret
|
||||
|
||||
|
||||
def update():
|
||||
'''
|
||||
When we are asked to update (regular interval) lets reap the cache
|
||||
'''
|
||||
salt.fileserver.reap_fileserver_cache_dir(os.path.join(__opts__['cachedir'], 'roots/hash'), find_file)
|
||||
try:
|
||||
salt.fileserver.reap_fileserver_cache_dir(
|
||||
os.path.join(__opts__['cachedir'], 'roots/hash'),
|
||||
find_file
|
||||
)
|
||||
except os.error:
|
||||
# Hash file won't exist if no files have yet been served up
|
||||
pass
|
||||
|
||||
|
||||
def file_hash(load, fnd):
|
||||
'''
|
||||
@ -125,6 +134,7 @@ def file_hash(load, fnd):
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
def file_list(load):
|
||||
'''
|
||||
Return a list of all files on the file server in a specified
|
||||
|
Loading…
Reference in New Issue
Block a user