From 4cad4f7d1f53189900f9024fa5478e98a64d3760 Mon Sep 17 00:00:00 2001 From: spisarski Date: Thu, 16 Nov 2017 16:07:47 -0700 Subject: Refactoring of ImageSettings to extend ImageConfig ImageSettings and glance_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the ImageSettings class. JIRA: SNAPS-217 Change-Id: I09f34531366f2a5bd3202c9cbbdef878b2542abe Signed-off-by: spisarski --- docs/how-to-use/APITests.rst | 2 +- docs/how-to-use/IntegrationTests.rst | 2 +- docs/how-to-use/LibraryUsage.rst | 11 ++++++----- docs/how-to-use/UnitTests.rst | 8 +++++++- 4 files changed, 15 insertions(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/how-to-use/APITests.rst b/docs/how-to-use/APITests.rst index f71426c..fe8e51d 100644 --- a/docs/how-to-use/APITests.rst +++ b/docs/how-to-use/APITests.rst @@ -566,6 +566,6 @@ settings_utils_tests.py - SettingsUtilsVmInstTests | test_derive_vm_inst_settings | Neutron 2 | Tests to ensure that derived VmInstanceSettings from an | | | | OpenStack VM instance is correct | +---------------------------------------+---------------+-----------------------------------------------------------+ -| test_derive_image_settings | Neutron 2 | Tests to ensure that derived ImageSettings from an | +| test_derive_image_settings | Neutron 2 | Tests to ensure that derived ImageConfig from an | | | | OpenStack VM instance is correct | +---------------------------------------+---------------+-----------------------------------------------------------+ diff --git a/docs/how-to-use/IntegrationTests.rst b/docs/how-to-use/IntegrationTests.rst index 1368eaf..f3d17f7 100644 --- a/docs/how-to-use/IntegrationTests.rst +++ b/docs/how-to-use/IntegrationTests.rst @@ -80,7 +80,7 @@ create_image_tests.py - CreateImageNegativeTests | Test Name | Glance API | Description | +=======================================+===============+===========================================================+ | test_bad_image_name | 1 & 2 | Ensures OpenStackImage.create() results in an Exception | -| | | being raised when the ImageSettings.name attribute has | +| | | being raised when the ImageConfig.name attribute has | | | | not been set | +---------------------------------------+---------------+-----------------------------------------------------------+ | test_bad_image_url | 1 & 2 | Ensures OpenStackImage.create() results in an Exception | diff --git a/docs/how-to-use/LibraryUsage.rst b/docs/how-to-use/LibraryUsage.rst index 9518c2b..a842be0 100644 --- a/docs/how-to-use/LibraryUsage.rst +++ b/docs/how-to-use/LibraryUsage.rst @@ -170,7 +170,7 @@ Create Image ------------ - ImageĀ - snaps.openstack.create\_image.OpenStackImage - - snaps.openstack.create\_image.ImageSettings + - snaps.config.image.ImageConfig - name - the image name (required) - image\_user - the default image user generally used by @@ -193,9 +193,10 @@ Create Image .. code:: python - from snaps.openstack.create_image import ImageSettings, OpenStackImage - image_settings = ImageSettings(name='image-name', image_user='ubuntu', img_format='qcow2', - url='http://uec-images.ubuntu.com/releases/trusty/14.04/ubuntu-14.04-server-cloudimg-amd64-disk1.img') + from snaps.openstack.create_image import OpenStackImage + from snaps.config.image import ImageConfig + image_settings = ImageConfig(name='image-name', image_user='ubuntu', img_format='qcow2', + url='http://uec-images.ubuntu.com/releases/trusty/14.04/ubuntu-14.04-server-cloudimg-amd64-disk1.img') image_creator = OpenStackImage(os_creds, image_settings) image_creator.create() @@ -571,7 +572,7 @@ Create VM Instance - userdata - the cloud-init script to execute after VM has been started - - image\_settings - see snaps.openstack.create\_image.ImageSettings + - image\_settings - see snaps.config.image.ImageConfig above (required) - keypair\_settings - see snaps.openstack.create\_keypairs.KeypairSettings above (optional) diff --git a/docs/how-to-use/UnitTests.rst b/docs/how-to-use/UnitTests.rst index 4a360d4..e6b95ab 100644 --- a/docs/how-to-use/UnitTests.rst +++ b/docs/how-to-use/UnitTests.rst @@ -60,11 +60,17 @@ SecurityGroupDomainObjectTests Ensures that all required members are included when constructing a SecurityGroup domain object +ImageConfigUnitTests +-------------------- + +Ensures that all required members are included when constructing a +ImageConfig object + ImageSettingsUnitTests ---------------------- Ensures that all required members are included when constructing a -ImageSettings object +ImageSettings object (deprecated see ImageConfigUnitTests) ImageDomainObjectTests ---------------------- -- cgit 1.2.3-korg