Browse Source

Fix container naming

Ben Firshman 12 years ago
parent
commit
3e680a2c7a
2 changed files with 5 additions and 2 deletions
  1. 2 1
      plum/cli/main.py
  2. 3 1
      plum/service.py

+ 2 - 1
plum/cli/main.py

@@ -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):
         """

+ 3 - 1
plum/service.py

@@ -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:]