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

Commit

Permalink
Merge pull request #4416 from chouseknecht/devel
Browse files Browse the repository at this point in the history
Fix network alias and network link comparison.
  • Loading branch information
Chris Houseknecht committed Aug 12, 2016
2 parents 0445697 + e7abbbf commit e5c530a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cloud/docker/docker_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -1373,16 +1373,18 @@ def has_network_differences(self):
if network.get('aliases') and not connected_networks[network['name']].get('Aliases'):
diff = True
if network.get('aliases') and connected_networks[network['name']].get('Aliases'):
if set(network.get('aliases')) != set(connected_networks[network['name']].get('Aliases')):
diff = True
for alias in network.get('aliases'):
if alias not in connected_networks[network['name']].get('Aliases', []):
diff = True
if network.get('links') and not connected_networks[network['name']].get('Links'):
diff = True
if network.get('links') and connected_networks[network['name']].get('Links'):
expected_links = []
for link, alias in network['links'].iteritems():
expected_links.append("%s:%s" % (link, alias))
if set(expected_links) != set(connected_networks[network['name']].get('Links', [])):
diff = True
for link in expected_links:
if link not in connected_networks[network['name']].get('Links', []):
diff = True
if diff:
different = True
differences.append(dict(
Expand Down

0 comments on commit e5c530a

Please sign in to comment.