mirror of https://github.com/docker/compose.git
Fixed python34 comparison issue
Signed-off-by: Zal Daroga <zaldaroga@yahoo.com>
This commit is contained in:
parent
55ee95b6d0
commit
4839baf877
|
@ -560,7 +560,7 @@ class Service(object):
|
|||
|
||||
def prioritized_networks(self):
|
||||
prioritized_networks = OrderedDict(
|
||||
sorted(self.networks.items(), key=lambda t: t[1].get('priority', 0), reverse=True))
|
||||
sorted(self.networks.items(), key=lambda t: t[1].get('priority', 0) or 0, reverse=True))
|
||||
return prioritized_networks
|
||||
|
||||
def connect_container_to_networks(self, container):
|
||||
|
|
|
@ -1278,7 +1278,8 @@ class CLITestCase(DockerClientTestCase):
|
|||
self.base_dir = 'tests/fixtures/networks'
|
||||
result = self.dispatch(['-f', 'ordered-networks.yml', 'up', '-d'])
|
||||
|
||||
assert 'Connecting to networks_bar\nConnecting to networks_foo' in result.stdout
|
||||
assert 'Connecting to networks_buzz\nConnecting to networks_foo' \
|
||||
'\nConnecting to networks_bar' in result.stdout
|
||||
|
||||
@v3_only()
|
||||
def test_up_with_healthcheck(self):
|
||||
|
|
|
@ -4,10 +4,12 @@ services:
|
|||
web:
|
||||
image: busybox
|
||||
command: top
|
||||
networks: ["foo", "bar"]
|
||||
networks: ["foo", "bar", "buzz"]
|
||||
|
||||
networks:
|
||||
foo:
|
||||
priority: 1
|
||||
priority: 2
|
||||
bar:
|
||||
priority: 2
|
||||
priority: 1
|
||||
buzz:
|
||||
priority: 3
|
||||
|
|
Loading…
Reference in New Issue