Skip to content

create_endpoint_config crashes when passing linked containers #1273

@alshabib

Description

@alshabib

When taking the example from the documentation at https://docker-py.readthedocs.io/en/stable/networks/ and attempting to run it, I get the following output.

This seems to be due to trying to configure linked containers which are then normalized in line 907 in docker/utils/utils.py where the list is sorted.

I am running version 1.10.3. Is there a known workaround for this or I am using it wrong?

endpoint_config = docker_cli.create_endpoint_config(
... aliases=['web', 'app'],
... links=['app_db'],
... ipv4_address='132.65.0.123'
... )
Traceback (most recent call last):
File "", line 4, in
File "/Users/ash/work/opencord/incubator/voltha/venv-darwin/lib/python2.7/site-packages/docker/api/container.py", line 163, in create_endpoint_config
return create_endpoint_config(self._version, _args, *_kwargs)
File "/Users/ash/work/opencord/incubator/voltha/venv-darwin/lib/python2.7/site-packages/docker/utils/utils.py", line 932, in create_endpoint_config
endpoint_config["Links"] = normalize_links(links)
File "/Users/ash/work/opencord/incubator/voltha/venv-darwin/lib/python2.7/site-packages/docker/utils/utils.py", line 907, in normalize_links
return ['{0}:{1}'.format(k, v) for k, v in sorted(links)]
ValueError: too many values to unpack

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions