Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Fix multiple prefix support in libcalico #151

Merged
merged 1 commit into from
Oct 7, 2016
Merged

Fix multiple prefix support in libcalico #151

merged 1 commit into from
Oct 7, 2016

Conversation

cutwater
Copy link
Contributor

@cutwater cutwater commented Oct 3, 2016

Function ensure_global_config now appends interface prefix for calico
if it is not present.

Copy link
Member

@nelljerram nelljerram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This basically LGTM - I've just suggested a couple of slight simplifications to the code. WDYT?

@@ -298,6 +298,18 @@ def ensure_global_config(self):
# We are always ready.
self.etcd_client.write(CALICO_V_PATH + "/Ready", "true")

def _ensure_interface_prefix(self):
try:
if_prefix = self.etcd_client.read(CONFIG_IF_PREF_PATH).value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move prefixes = ... line here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if_prefix = self.etcd_client.read(CONFIG_IF_PREF_PATH).value
except EtcdKeyNotFound:
self.etcd_client.write(CONFIG_IF_PREF_PATH, IF_PREFIX)
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete previous two lines, and instead put prefixes = []

Copy link
Contributor Author

@cutwater cutwater Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

ensure_global_config now appends interface prefix for calico
if it is not present.
Copy link
Member

@nelljerram nelljerram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nelljerram nelljerram merged commit 6d4a345 into projectcalico:master Oct 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants