mirror of https://github.com/docker/compose.git
Fix container naming
This commit is contained in:
parent
d3bd7f3239
commit
3e680a2c7a
|
@ -8,6 +8,7 @@ from docopt import docopt
|
|||
from inspect import getdoc
|
||||
|
||||
from .. import __version__
|
||||
from ..service import get_container_name
|
||||
from ..service_collection import ServiceCollection
|
||||
from .command import Command
|
||||
|
||||
|
@ -77,7 +78,7 @@ class TopLevelCommand(Command):
|
|||
"""
|
||||
for service in self.service_collection:
|
||||
for container in service.containers:
|
||||
print container['Names'][0]
|
||||
print get_container_name(container)
|
||||
|
||||
def run(self, options):
|
||||
"""
|
||||
|
|
|
@ -103,4 +103,6 @@ def parse_name(name):
|
|||
|
||||
|
||||
def get_container_name(container):
|
||||
return container['Names'][0][1:]
|
||||
for name in container['Names']:
|
||||
if len(name.split('/')) == 2:
|
||||
return name[1:]
|
||||
|
|
Loading…
Reference in New Issue