Merge pull request #4416 from chouseknecht/devel
Fix network alias and network link comparison.
This commit is contained in:
commit
e5c530a488
1 changed files with 6 additions and 4 deletions
|
@ -1373,16 +1373,18 @@ class Container(DockerBaseClass):
|
||||||
if network.get('aliases') and not connected_networks[network['name']].get('Aliases'):
|
if network.get('aliases') and not connected_networks[network['name']].get('Aliases'):
|
||||||
diff = True
|
diff = True
|
||||||
if network.get('aliases') and connected_networks[network['name']].get('Aliases'):
|
if network.get('aliases') and connected_networks[network['name']].get('Aliases'):
|
||||||
if set(network.get('aliases')) != set(connected_networks[network['name']].get('Aliases')):
|
for alias in network.get('aliases'):
|
||||||
diff = True
|
if alias not in connected_networks[network['name']].get('Aliases', []):
|
||||||
|
diff = True
|
||||||
if network.get('links') and not connected_networks[network['name']].get('Links'):
|
if network.get('links') and not connected_networks[network['name']].get('Links'):
|
||||||
diff = True
|
diff = True
|
||||||
if network.get('links') and connected_networks[network['name']].get('Links'):
|
if network.get('links') and connected_networks[network['name']].get('Links'):
|
||||||
expected_links = []
|
expected_links = []
|
||||||
for link, alias in network['links'].iteritems():
|
for link, alias in network['links'].iteritems():
|
||||||
expected_links.append("%s:%s" % (link, alias))
|
expected_links.append("%s:%s" % (link, alias))
|
||||||
if set(expected_links) != set(connected_networks[network['name']].get('Links', [])):
|
for link in expected_links:
|
||||||
diff = True
|
if link not in connected_networks[network['name']].get('Links', []):
|
||||||
|
diff = True
|
||||||
if diff:
|
if diff:
|
||||||
different = True
|
different = True
|
||||||
differences.append(dict(
|
differences.append(dict(
|
||||||
|
|
Loading…
Reference in a new issue