From 6dd10aa17c12bac0c3c185b15a444a5437563c14 Mon Sep 17 00:00:00 2001 From: spisarski Date: Fri, 17 Nov 2017 13:11:09 -0700 Subject: Refactoring of QoSSettings to extend QoSConfig QoSSettings and cinder_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the QoSSettings class. JIRA: SNAPS-222 Change-Id: I6385717b78db413c496b15b8c4b76ffabe9797c1 Signed-off-by: spisarski --- snaps/openstack/utils/tests/cinder_utils_tests.py | 20 ++++++++++---------- snaps/openstack/utils/tests/settings_utils_tests.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'snaps/openstack/utils') diff --git a/snaps/openstack/utils/tests/cinder_utils_tests.py b/snaps/openstack/utils/tests/cinder_utils_tests.py index 6fd92e3..547a6f9 100644 --- a/snaps/openstack/utils/tests/cinder_utils_tests.py +++ b/snaps/openstack/utils/tests/cinder_utils_tests.py @@ -18,8 +18,8 @@ import uuid import time from cinderclient.exceptions import NotFound, BadRequest +from snaps.config.qos import Consumer, QoSConfig from snaps.openstack import create_volume -from snaps.openstack.create_qos import QoSSettings, Consumer from snaps.openstack.create_volume import VolumeSettings from snaps.openstack.create_volume_type import ( VolumeTypeSettings, VolumeTypeEncryptionSettings, ControlLocation) @@ -196,8 +196,8 @@ class CinderUtilsQoSTests(OSComponentTestCase): """ Tests the cinder_utils.create_qos() """ - qos_settings = QoSSettings(name=self.qos_name, specs=self.specs, - consumer=Consumer.both) + qos_settings = QoSConfig( + name=self.qos_name, specs=self.specs, consumer=Consumer.both) self.qos = cinder_utils.create_qos(self.cinder, qos_settings) self.assertIsNotNone(self.qos) @@ -213,8 +213,8 @@ class CinderUtilsQoSTests(OSComponentTestCase): """ Tests the cinder_utils.create_qos() """ - qos_settings = QoSSettings(name=self.qos_name, specs=self.specs, - consumer=Consumer.front_end) + qos_settings = QoSConfig( + name=self.qos_name, specs=self.specs, consumer=Consumer.front_end) self.qos = cinder_utils.create_qos(self.cinder, qos_settings) self.assertIsNotNone(self.qos) @@ -230,8 +230,8 @@ class CinderUtilsQoSTests(OSComponentTestCase): """ Tests the cinder_utils.create_qos() """ - qos_settings = QoSSettings(name=self.qos_name, specs=self.specs, - consumer=Consumer.back_end) + qos_settings = QoSConfig( + name=self.qos_name, specs=self.specs, consumer=Consumer.back_end) self.qos = cinder_utils.create_qos(self.cinder, qos_settings) self.assertIsNotNone(self.qos) @@ -247,7 +247,7 @@ class CinderUtilsQoSTests(OSComponentTestCase): """ Tests the cinder_utils.create_qos() """ - qos_settings = QoSSettings(name=self.qos_name, consumer=Consumer.both) + qos_settings = QoSConfig(name=self.qos_name, consumer=Consumer.both) self.qos = cinder_utils.create_qos(self.cinder, qos_settings) self.assertIsNotNone(self.qos) self.assertEqual(self.qos_name, self.qos.name) @@ -463,8 +463,8 @@ class CinderUtilsVolumeTypeCompleteTests(OSComponentTestCase): self.vol_type_name = self.__class__.__name__ + '-' + str(guid) self.specs = {'foo': 'bar'} self.cinder = cinder_utils.cinder_client(self.os_creds) - qos_settings = QoSSettings(name=self.qos_name, specs=self.specs, - consumer=Consumer.both) + qos_settings = QoSConfig( + name=self.qos_name, specs=self.specs, consumer=Consumer.both) self.qos = cinder_utils.create_qos(self.cinder, qos_settings) self.volume_type = None diff --git a/snaps/openstack/utils/tests/settings_utils_tests.py b/snaps/openstack/utils/tests/settings_utils_tests.py index 3fba4fc..10b5114 100644 --- a/snaps/openstack/utils/tests/settings_utils_tests.py +++ b/snaps/openstack/utils/tests/settings_utils_tests.py @@ -20,6 +20,7 @@ import uuid from snaps.config.flavor import FlavorConfig from snaps.config.keypair import KeypairConfig +from snaps.config.qos import Consumer from snaps.domain.flavor import Flavor from snaps.domain.volume import ( Volume, VolumeType, VolumeTypeEncryption, QoSSpec) @@ -28,7 +29,6 @@ from snaps.openstack import ( create_keypairs, create_instance) from snaps.openstack.create_network import ( NetworkSettings, OpenStackNetwork, SubnetSettings) -from snaps.openstack.create_qos import Consumer from snaps.openstack.create_security_group import ( SecurityGroupRuleSettings, Direction, Protocol, OpenStackSecurityGroup, SecurityGroupSettings) -- cgit 1.2.3-korg