From fc2b3139c7629a601f1a716aea7e65ec4b5fd414 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Mon, 4 Jun 2018 14:14:44 +0200 Subject: Provide support for local images There might be cases where we want to test local images and the image location in config.yml is locally Change-Id: I29f115de5c80db187ecc2b260c386b377fafd6d2 Signed-off-by: Manuel Buil --- sfc/lib/openstack_utils.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'sfc') diff --git a/sfc/lib/openstack_utils.py b/sfc/lib/openstack_utils.py index 7e629c26..09b93f37 100644 --- a/sfc/lib/openstack_utils.py +++ b/sfc/lib/openstack_utils.py @@ -42,8 +42,19 @@ class OpenStackSFC: def register_glance_image(self, name, url, img_format, public): logger.info("Registering the image...") - image_settings = ImageConfig(name=name, img_format=img_format, url=url, - public=public, image_user='admin') + # Check whether the image is local or not + if 'http' in url: + image_settings = ImageConfig(name=name, + img_format=img_format, + url=url, + public=public, + image_user='admin') + else: + image_settings = ImageConfig(name=name, + img_format=img_format, + image_file=url, + public=public, + image_user='admin') # TODO Remove this when tacker is part of SNAPS self.image_settings = image_settings -- cgit 1.2.3-korg