fix the KeyError bug in unique_service()

This commit is contained in:
Noah Levitt 2017-05-26 14:52:36 -07:00
parent 492c97ad31
commit b063fdc1fb
2 changed files with 2 additions and 2 deletions

View File

@ -246,7 +246,7 @@ class ServiceRegistry(object):
row, candidate),
return_changes='always').run()
new_val = result['changes'][0]['new_val']
if all([new_val[k] == candidate[k] for k in candidate
if all([new_val.get(k) == candidate[k] for k in candidate
if k not in ('first_heartbeat', 'last_heartbeat')]):
# candidate is the unique_service, send a heartbeat
del candidate['first_heartbeat'] # don't touch first_heartbeat

View File

@ -3,7 +3,7 @@ import codecs
setuptools.setup(
name='doublethink',
version='0.2.0.dev81',
version='0.2.0.dev82',
packages=['doublethink'],
classifiers=[
'Programming Language :: Python :: 2.7',