Skip to content

Instantly share code, notes, and snippets.

@danudey
Last active December 25, 2015 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danudey/e82784456e0fe4e8b692 to your computer and use it in GitHub Desktop.
Save danudey/e82784456e0fe4e8b692 to your computer and use it in GitHub Desktop.
A strange bug I ran into today. And only today. And not before.
# The problem happens on line 12 (which is actually salt/fileserver/roots.py:153). fp_.read().split(':') returns ['']
#
# Why this is weird:
#
# 1. The file actually does have the appropriate content when checked before/after (hash:mtime)
# 2. This always happens to the same specific servers when I 'salt * state.highstate'
# 3. If I state.highstate that server only, it works fine
# if we have a cache, serve that if the mtime hasn't changed
if os.path.exists(cache_path):
with salt.utils.fopen(cache_path, 'rb') as fp_:
hsum, mtime = fp_.read().split(':')
if os.path.getmtime(path) == mtime:
# check if mtime changed
ret['hsum'] = hsum
return ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment