summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-11-16 18:26:13 -0700
committerspisarski <s.pisarski@cablelabs.com>2017-11-20 07:32:31 -0700
commitf9d332f6c67f5e0cb70c1570499996926ffbdf5c (patch)
tree8923eb58594217b45599761280e9659935b48713 /examples
parent4cad4f7d1f53189900f9024fa5478e98a64d3760 (diff)
Refactoring of FlavorSettings to extend FlavorConfig
FlavorSettings and glance_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the FlavorSettings class. JIRA: SNAPS-216 Change-Id: Ie9532fcbe16377d4ab608bdacd1982c3c6628fe9 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/demo.py5
-rw-r--r--examples/launch.py7
2 files changed, 7 insertions, 5 deletions
diff --git a/examples/demo.py b/examples/demo.py
index faf6459..8837bd2 100644
--- a/examples/demo.py
+++ b/examples/demo.py
@@ -34,9 +34,10 @@ network.create()
# Flavors
-from snaps.openstack.create_flavor import FlavorSettings, OpenStackFlavor
+from snaps.config.flavor import FlavorConfig
+from snaps.openstack.create_flavor import OpenStackFlavor
-flavor_settings = FlavorSettings(name='test-flavor', ram=256, disk=10, vcpus=2)
+flavor_settings = FlavorConfig(name='test-flavor', ram=256, disk=10, vcpus=2)
flavor = OpenStackFlavor(os_creds, flavor_settings)
flavor.create()
diff --git a/examples/launch.py b/examples/launch.py
index debb52f..499d259 100644
--- a/examples/launch.py
+++ b/examples/launch.py
@@ -26,9 +26,10 @@ import os
import yaml
from snaps import file_utils
-from snaps.openstack.create_flavor import FlavorSettings, OpenStackFlavor
-from snaps.openstack.create_image import OpenStackImage
+from snaps.config.flavor import FlavorConfig
from snaps.config.image import ImageConfig
+from snaps.openstack.create_flavor import OpenStackFlavor
+from snaps.openstack.create_image import OpenStackImage
from snaps.openstack.create_instance import VmInstanceSettings
from snaps.openstack.create_keypairs import KeypairSettings, OpenStackKeypair
from snaps.openstack.create_network import (
@@ -635,7 +636,7 @@ def main(arguments):
# Create flavors
flavors_dict = __create_instances(
- os_creds_dict, OpenStackFlavor, FlavorSettings,
+ os_creds_dict, OpenStackFlavor, FlavorConfig,
os_config.get('flavors'), 'flavor', clean, users_dict)
creators.append(flavors_dict)