Pass filepointers to the serialize load functions.

This commit is contained in:
William Huba 2015-09-15 16:17:27 -04:00 committed by rallytime
parent f1c9de7ed9
commit d12be52355

View file

@ -4075,10 +4075,10 @@ def serialize(name,
if os.path.isfile(name):
if formatter == 'yaml':
with salt.utils.fopen(name, 'r') as fhr:
existing_data = yaml.safe_load(fhr.read())
existing_data = yaml.safe_load(fhr)
elif formatter == 'json':
with salt.utils.fopen(name, 'r') as fhr:
existing_data = json.load(fhr.read())
existing_data = json.load(fhr)
else:
return {'changes': {},
'comment': ('{0} format is not supported for merging'