From: Thanh Ha Date: Sat, 9 Dec 2017 01:45:25 +0000 (-0500) Subject: Automatically hide protected images X-Git-Tag: v0.11.0~1 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F87%2F7887%2F2;p=releng%2Flftools.git Automatically hide protected images We are not able to delete protected images so automatically filter them out of our results. Issue: RELENG-705 Change-Id: Id7fa5ab73ec912aac9b04dfb30c29492320402f2 Signed-off-by: Thanh Ha --- diff --git a/lftools/openstack/image.py b/lftools/openstack/image.py index 4c9ac98d..8b2a77f2 100644 --- a/lftools/openstack/image.py +++ b/lftools/openstack/image.py @@ -31,6 +31,8 @@ def _filter_images(images, days=0, hide_public=False, ci_managed=True): continue if ci_managed and image.metadata.get('ci_managed', None) != 'yes': continue + if image.protected: + continue if days and ( datetime.strptime(image.created_at, '%Y-%m-%dT%H:%M:%SZ') >= datetime.now() - timedelta(days=days)):