From 3c387ae1c18c4a80a752c3e5a2409f4a602b9e20 Mon Sep 17 00:00:00 2001 From: spisarski Date: Fri, 17 Nov 2017 14:05:29 -0700 Subject: Refactoring of VolumeTypeSettings to extend VolumeTypeConfig This also includes VolumeTypeEncryptionSettings extending to VolumeTypeEncryptionConfig which is a member of VolumeTypeConfig VolumeTypeSettings and cinder_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the VolumeTypeSettings class. JIRA: SNAPS-228 Change-Id: Iaa9c7a1cd810cf63d1badb00f71bcdcefb527e12 Signed-off-by: spisarski --- snaps/openstack/utils/settings_utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'snaps/openstack/utils/settings_utils.py') diff --git a/snaps/openstack/utils/settings_utils.py b/snaps/openstack/utils/settings_utils.py index e85bd08..c4714cc 100644 --- a/snaps/openstack/utils/settings_utils.py +++ b/snaps/openstack/utils/settings_utils.py @@ -15,6 +15,8 @@ import uuid from snaps import file_utils +from snaps.config.volume_type import ( + ControlLocation, VolumeTypeEncryptionConfig, VolumeTypeConfig) from snaps.config.flavor import FlavorConfig from snaps.config.keypair import KeypairConfig from snaps.config.router import RouterConfig @@ -25,8 +27,6 @@ from snaps.openstack.create_network import ( from snaps.openstack.create_security_group import ( SecurityGroupSettings, SecurityGroupRuleSettings) from snaps.openstack.create_volume import VolumeSettings -from snaps.openstack.create_volume_type import ( - VolumeTypeSettings, VolumeTypeEncryptionSettings, ControlLocation) from snaps.openstack.utils import ( neutron_utils, nova_utils, heat_utils, glance_utils) @@ -161,7 +161,7 @@ def create_volume_settings(volume): multi_attach=volume.multi_attach) -def create_volume_type_settings(volume_type): +def create_volume_type_config(volume_type): """ Returns a VolumeTypeSettings object :param volume_type: a SNAPS-OO VolumeType object @@ -175,7 +175,7 @@ def create_volume_type_settings(volume_type): else: control = ControlLocation.back_end - encrypt_settings = VolumeTypeEncryptionSettings( + encrypt_settings = VolumeTypeEncryptionConfig( name=volume_type.encryption.__class__, provider_class=volume_type.encryption.provider, control_location=control, @@ -186,7 +186,7 @@ def create_volume_type_settings(volume_type): if volume_type.qos_spec: qos_spec_name = volume_type.qos_spec.name - return VolumeTypeSettings( + return VolumeTypeConfig( name=volume_type.name, encryption=encrypt_settings, qos_spec_name=qos_spec_name, public=volume_type.public) -- cgit 1.2.3-korg