Gate salt.states.file.py msgpack

Fixes #22708
This commit is contained in:
Colton Myers 2015-04-17 14:29:23 -06:00
parent 0b295e2c87
commit d7e8741f02

View file

@ -272,7 +272,8 @@ def _load_accumulators():
with open(path, 'rb') as f:
loaded = serial.load(f)
return loaded if loaded else ret
except IOError:
except (IOError, NameError):
# NameError is a msgpack error from salt-ssh
return ret
loaded = _deserialize(_get_accumulator_filepath())
@ -286,8 +287,12 @@ def _persist_accummulators(accumulators, accumulators_deps):
'accumulators_deps': accumulators_deps}
serial = salt.payload.Serial(__opts__)
with open(_get_accumulator_filepath(), 'w+b') as f:
serial.dump(accumm_data, f)
try:
with open(_get_accumulator_filepath(), 'w+b') as f:
serial.dump(accumm_data, f)
except NameError:
# msgpack error from salt-ssh
pass
def _check_user(user, group):