mirror of https://github.com/docker/docker-py.git
Change format of extra hosts
Signed-off-by: Michael Hankin <mjhankin1@gmail.com>
This commit is contained in:
parent
94e3d3dcb9
commit
8d770b012d
|
|
@ -566,7 +566,7 @@ def format_environment(environment):
|
|||
|
||||
def format_extra_hosts(extra_hosts):
|
||||
return [
|
||||
'{}:{}'.format(k, v) for k, v in sorted(six.iteritems(extra_hosts))
|
||||
'{} {}'.format(v, k) for k, v in sorted(six.iteritems(extra_hosts))
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -588,8 +588,8 @@ class ServiceTest(BaseAPIIntegrationTest):
|
|||
assert 'Hosts' in svc_info['Spec']['TaskTemplate']['ContainerSpec']
|
||||
hosts = svc_info['Spec']['TaskTemplate']['ContainerSpec']['Hosts']
|
||||
assert len(hosts) == 2
|
||||
assert 'foobar:127.0.0.1' in hosts
|
||||
assert 'baz:8.8.8.8' in hosts
|
||||
assert '127.0.0.1 foobar' in hosts
|
||||
assert '8.8.8.8 baz' in hosts
|
||||
|
||||
@requires_api_version('1.25')
|
||||
def test_create_service_with_hostname(self):
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class ContainerCollectionTest(unittest.TestCase):
|
|||
'Dns': ['8.8.8.8'],
|
||||
'DnsOptions': ['foo'],
|
||||
'DnsSearch': ['example.com'],
|
||||
'ExtraHosts': ['foo:1.2.3.4'],
|
||||
'ExtraHosts': ['1.2.3.4 foo'],
|
||||
'GroupAdd': ['blah'],
|
||||
'IpcMode': 'foo',
|
||||
'KernelMemory': 123,
|
||||
|
|
|
|||
Loading…
Reference in New Issue