diff options
author | Manuel Buil <mbuil@suse.com> | 2018-06-04 14:14:44 +0200 |
---|---|---|
committer | Manuel Buil <mbuil@suse.com> | 2018-06-04 14:14:44 +0200 |
commit | fc2b3139c7629a601f1a716aea7e65ec4b5fd414 (patch) | |
tree | 3dd9e391be1dcaf5aa1112a379b87696136a0742 | |
parent | 1ec06237327293d18c494a915faed756188447b0 (diff) |
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 <mbuil@suse.com>
-rw-r--r-- | sfc/lib/openstack_utils.py | 15 |
1 files changed, 13 insertions, 2 deletions
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 |