aboutsummaryrefslogtreecommitdiff
path: root/kolla
diff options
context:
space:
mode:
authorMartin André <m.andre@redhat.com>2017-01-13 15:21:49 +0100
committerMartin André <m.andre@redhat.com>2017-01-13 15:21:49 +0100
commit5fd23773641900ad5eebffbeea2e3d96cef138d8 (patch)
tree159169634af7ca1c923ccdafb89ab3bedd26a96d /kolla
parent75ec97803a5bb32ae614497857a33d98f8c5ba19 (diff)
downloadkolla-5fd23773641900ad5eebffbeea2e3d96cef138d8.tar.gz
kolla-5fd23773641900ad5eebffbeea2e3d96cef138d8.zip
Support filtering output of --list-images
In an effort to be more consistent in the behavior of kolla-build, only return matched images in the output of kolla-build --list-images. Change-Id: I583e20f181535fa1879730cbe88dd76276c08a80 Closes-Bug: #1656146
Diffstat (limited to 'kolla')
-rwxr-xr-xkolla/common/config.py2
-rwxr-xr-xkolla/image/build.py6
2 files changed, 6 insertions, 2 deletions
diff --git a/kolla/common/config.py b/kolla/common/config.py
index cacd20cb3..f31c9e452 100755
--- a/kolla/common/config.py
+++ b/kolla/common/config.py
@@ -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,
diff --git a/kolla/image/build.py b/kolla/image/build.py
index 35029f198..073c10788 100755
--- a/kolla/image/build.py
+++ b/kolla/image/build.py
@@ -870,7 +870,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):
@@ -973,6 +975,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: