summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/settings_utils.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-11-17 14:05:29 -0700
committerspisarski <s.pisarski@cablelabs.com>2017-11-20 10:12:59 -0700
commit3c387ae1c18c4a80a752c3e5a2409f4a602b9e20 (patch)
tree87a80e4650f0587a3fcd55d5ad3ecc535ee09deb /snaps/openstack/utils/settings_utils.py
parent6dd10aa17c12bac0c3c185b15a444a5437563c14 (diff)
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 <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils/settings_utils.py')
-rw-r--r--snaps/openstack/utils/settings_utils.py10
1 files changed, 5 insertions, 5 deletions
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)