Id is not alway available

pull/1/head
Christophe Mehay 8 years ago
parent 99578fd6ec
commit 17c613d694

@ -183,7 +183,7 @@ You have 4 available objects in your templates.
- List of containers names
- Names are sorted by length, but container ID will be the last element.
- `id`
- Hexadecimal container ID
- Hexadecimal container ID (if available, else empty string)
- `links`
- Tuple of `link` object related to this container

@ -74,7 +74,7 @@ class DockerLinks(object):
names.sort(key=len)
hexa.sort()
item["names"] = names
item["id"] = hexa
item["id"] = hexa[0] if len(hexa) else ''
def links(self, *args):
"Return dictionnary of links in container"
@ -103,7 +103,7 @@ class DockerLinks(object):
ctn.append(Container(ip=ip,
env=item['environment'],
names=item['names'],
id=item['id'][0],
id=item['id'],
links=links))
self._containers = tuple(ctn)
return self._containers

@ -9,7 +9,7 @@ setup(
name='pyentrypoint',
version='0.1.17',
version='0.1.18',
packages=find_packages(),

Loading…
Cancel
Save