Skip to content

Commit

Permalink
Merge branch 'etcd' of github.com:Metaswitch/calico-docker into etcd
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdee committed Feb 9, 2015
2 parents 9043431 + b2a0f9a commit 6207b82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions calicoctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,16 @@ def get_group_id(self, name):
:param name:
:return: string UUID for the group, or None if the name was not found.
"""
groups = self.client.read(GROUPS_PATH, recursive=True,).children
for child in groups:
(_, _, _, _, group_id, final_key) = child.key.split("/", 5)
if final_key == "name":
if child.value == name:
return group_id
try:
groups = self.client.read(GROUPS_PATH, recursive=True,).children
for child in groups:
(_, _, _, _, group_id, final_key) = child.key.split("/", 5)
if final_key == "name":
if child.value == name:
return group_id
except KeyError as e:
# Means the GROUPS_PATH was not set up. So, group does not exist.
pass
return None

def add_container_to_group(self, container_id, group_name):
Expand Down
2 changes: 1 addition & 1 deletion node/adapter/netns.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ def set_up_endpoint(ip, cpid, in_container=False):
(cpid, VETH_NAME), shell=True).strip()

# Return an Endpoint
return Endpoint(id=ep_id, addrs=[ip], state="enabled", mac=mac)
return Endpoint(id=ep_id, addrs=[{"addr":ip}], state="enabled", mac=mac)

0 comments on commit 6207b82

Please sign in to comment.