Merge "Support filtering output of --list-images"

This commit is contained in:
Jenkins 2017-01-18 13:21:23 +00:00 committed by Gerrit Code Review
commit fa09b3e077
2 changed files with 6 additions and 2 deletions

View File

@ -160,7 +160,7 @@ _CLI_OPTS = [
cfg.BoolOpt('list-dependencies', short='l',
help='Show image dependencies (filtering supported)'),
cfg.BoolOpt('list-images',
help='Show all available images'),
help='Show all available images (filtering supported)'),
cfg.StrOpt('namespace', short='n', default='kolla',
help='The Docker namespace name'),
cfg.BoolOpt('cache', default=True,

View File

@ -898,7 +898,9 @@ class KollaWorker(object):
f.write(dot.source)
def list_images(self):
for count, image in enumerate(self.images):
for count, image in enumerate([
image for image in self.images if image.status == STATUS_MATCHED
]):
print(count + 1, ':', image.name)
def list_dependencies(self):
@ -1001,6 +1003,8 @@ def run_build():
return
if conf.list_images:
kolla.build_image_list()
kolla.find_parents()
kolla.filter_images()
kolla.list_images()
return
if conf.list_dependencies: