Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a problem in parse_etcd_response #1

Open
jpuyy opened this issue Jul 23, 2015 · 0 comments
Open

a problem in parse_etcd_response #1

jpuyy opened this issue Jul 23, 2015 · 0 comments

Comments

@jpuyy
Copy link

jpuyy commented Jul 23, 2015

I got an error print out

  File "/Users/jpuyy/bin/automation/etcd.py", line 32, in parse_etcd_response
    if 'dir' in data and data['dir'] and data['nodes']:
KeyError: 'nodes'

Because the directory is empty. So I changed from here.
https://github.com/oreh/simpletcd/blob/master/simpletcd/etcd.py#L106

if 'dir' in data and data['dir'] and data.get('nodes'):
    result[key] = {}
    for n in data['nodes']:
        result[key].update(parse_etcd_response(n, data['key']))
elif data.get('value'):
    result[key] = data['value']
else:
    result[key] = ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant