etcd-io / zetcd

Serve the Apache Zookeeper API but back it with an etcd cluster
Apache License 2.0
1.09k stars 94 forks source link

zketcd: don't crash on getting root directory #87

Closed heyitsanthony closed 7 years ago

heyitsanthony commented 7 years ago

/cc @tsuraan

tsuraan commented 7 years ago

Yeah, that works better than mine; the python client actually returns None as the value, which seems more appropriate.

Is rootPath guaranteed to be the only node that behaves this way? Would it be better to check the length of Responses and Kvs to ensure an index out of range panic never happens?

heyitsanthony commented 7 years ago

It should only happen for the root node; there are a few special cases for the root node already.

tsuraan commented 7 years ago

Okay, cool. I'll close my request.

xiang90 commented 7 years ago

lgtm