Fixed a bug in the consul.py module that was preventing services (#34051)

from registering in consul.agent_service_register. A nonexistent
dict key was being referenced, causing an Excpetion and failure to
register the service. This fix required only changing the offending
line to use the "get" method and supplying a default value.
This commit is contained in:
Tim Egbert 2016-06-16 09:20:41 -06:00 committed by Nicole Thomas
parent 8ba117c7f6
commit bca437128e

View file

@ -84,7 +84,7 @@ def _query(function,
)
if result.get('status', None) == salt.ext.six.moves.http_client.OK:
ret['data'] = result['dict']
ret['data'] = result.get('dict', result)
ret['res'] = True
elif result.get('status', None) == salt.ext.six.moves.http_client.NO_CONTENT:
ret['res'] = False