diff options
author | spisarski <s.pisarski@cablelabs.com> | 2017-08-23 13:26:36 -0600 |
---|---|---|
committer | spisarski <s.pisarski@cablelabs.com> | 2017-09-08 09:27:24 -0600 |
commit | c021ff613049c36943916296d736a3388238705a (patch) | |
tree | 3fa92a59107737eff8952b283916dbe4c8ec9143 /snaps/openstack/create_image.py | |
parent | 23b3a1f209ee613982de9e759b1879d771b91f5c (diff) |
Enhanced launch.py app to support all types.
Added application support for users, projects, and
security groups. In addition, added support for multiple
credential sets so one can manage multiple projects
potentially on multiple clouds.
Added Jinja2 template support for substituting values
in the template file with values contained in the
environment file.
Added ansible substituion value for a VM's floating IP.
Changed credentials interface attribute's default value
from 'admin' to 'public'.
Added optional pre_sleep_time attribute to ansible execution
that will wait for a given number of seconds prior to attempting
to apply a playbook to a set of VMs.
JIRA: SNAPS-4, SNAPS-5, SNAPS-6, SNAPS-26
Change-Id: I67b8d69a3b06a43631d80e8fe0c56e02773dbfbe
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/create_image.py')
-rw-r--r-- | snaps/openstack/create_image.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/snaps/openstack/create_image.py b/snaps/openstack/create_image.py index a4c9357..537824d 100644 --- a/snaps/openstack/create_image.py +++ b/snaps/openstack/create_image.py @@ -61,8 +61,8 @@ class OpenStackImage: if self.__image: logger.info('Found image with name - ' + self.image_settings.name) return self.__image - elif self.image_settings.exists and not self.image_settings.url \ - and not self.image_settings.image_file: + elif (self.image_settings.exists and not self.image_settings.url + and not self.image_settings.image_file): raise ImageCreationError( 'Image with does not exist with name - ' + self.image_settings.name) @@ -257,8 +257,13 @@ class ImageSettings: self.url = kwargs.get('url') if not self.url: self.url = kwargs.get('download_url') + if self.url == 'None': + self.url = None self.image_file = kwargs.get('image_file') + if self.image_file == 'None': + self.image_file = None + self.extra_properties = kwargs.get('extra_properties') self.nic_config_pb_loc = kwargs.get('nic_config_pb_loc') @@ -299,10 +304,6 @@ class ImageSettings: raise ImageSettingsError( 'URL or image file must be set or image must already exist') - if self.url and self.image_file: - raise ImageSettingsError( - 'Please set either URL or image file, not both') - if not self.image_user: raise ImageSettingsError('Image user is required') |