Kaydet (Commit) 8d770b01 authored tarafından Michael Hankin's avatar Michael Hankin

Change format of extra hosts

Signed-off-by: 's avatarMichael Hankin <mjhankin1@gmail.com>
üst 94e3d3dc
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment