From 06758272a444331b47b60cdbea5e54017d36b97c Mon Sep 17 00:00:00 2001 From: ivo5307 Date: Thu, 13 Aug 2015 11:02:02 -0500 Subject: [PATCH] Copy Pasted CBS configs to the proper images place * No changes made to them Change-Id: I91e3cc4e929b9c59d5e02c97ad4703db34dc43dd --- cloudcafe/compute/images_api/config.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cloudcafe/compute/images_api/config.py b/cloudcafe/compute/images_api/config.py index 51b7ae16..f6d2d1a5 100644 --- a/cloudcafe/compute/images_api/config.py +++ b/cloudcafe/compute/images_api/config.py @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. """ +import json + from cloudcafe.common.models.configuration import ConfigSectionInterface @@ -102,3 +104,17 @@ class ImagesConfig(ConfigSectionInterface): """Base container name convention which will be used as a static part of the container automated name creation""" return self.get("image_base_container") + + @property + def image_filter(self): + """Expects Json. Returns an empty dictionary by default (no filter). + Dictionary keys should be attributes of the image model, and key values + should be a list of values for that model attribute. + Used by some tests to decide which images to target for a given + test run. + """ + return json.loads(self.get('image_filter', '{}')) + + @property + def image_filter_mode(self): + return self.get("image_filter_mode", 'inclusion')