From f2bd5270c66cc7b46d6642070ef64719c46d1be4 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Fri, 8 Dec 2017 20:45:25 -0500 Subject: [PATCH] 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 --- lftools/openstack/image.py | 2 ++ 1 file changed, 2 insertions(+) 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)): -- 2.16.6