diff options
author | 2017-11-20 13:51:18 -0700 | |
---|---|---|
committer | 2017-11-20 13:51:18 -0700 | |
commit | 594e4d2b15dcf59fc7dc1b8380b096382a0b1cb1 (patch) | |
tree | e6fc560f93257f5e2d142a6099993830cd5a479f /examples | |
parent | 6d6a6d72ca1050525010bbb9c2569b85e050ad62 (diff) |
Refactoring of VmInstanceSettings to extend VmInstanceConfig
VmInstanceSettings, FloatingIPSettings and nova_utils have a
runtime cyclical dependency. This patch reduces this dependency and
deprecates the VmInstanceSettings and FloatingIPSettings class with
snaps.config.vm_inst VmInstanceConfig and FloatingIpConfg classes
JIRA: SNAPS-218
Change-Id: I95688130256bca1df4a5c347bdb741019ae0937e
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/demo.py | 8 | ||||
-rw-r--r-- | examples/launch.py | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/examples/demo.py b/examples/demo.py index c888d7b..87c095b 100644 --- a/examples/demo.py +++ b/examples/demo.py @@ -1,4 +1,7 @@ import logging + +from snaps.config.vm_inst import VmInstanceConfig + logging.basicConfig(level=logging.INFO) # Credentials @@ -48,12 +51,11 @@ flavor.create() # Instances from snaps.config.network import PortConfig -from snaps.openstack.create_instance import ( - VmInstanceSettings, OpenStackVmInstance) +from snaps.openstack.create_instance import OpenStackVmInstance port_settings = PortConfig( name='test-port', network_name=network_settings.name) -instance_settings = VmInstanceSettings( +instance_settings = VmInstanceConfig( name='test-inst', flavor=flavor_settings.name, port_settings=[port_settings]) diff --git a/examples/launch.py b/examples/launch.py index 9320512..8810c32 100644 --- a/examples/launch.py +++ b/examples/launch.py @@ -34,11 +34,11 @@ from snaps.config.project import ProjectConfig from snaps.config.qos import QoSConfig from snaps.config.router import RouterConfig from snaps.config.user import UserConfig +from snaps.config.vm_inst import VmInstanceConfig from snaps.config.volume import VolumeConfig from snaps.config.volume_type import VolumeTypeConfig 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 OpenStackKeypair from snaps.openstack.create_network import OpenStackNetwork from snaps.openstack.create_project import OpenStackProject @@ -218,7 +218,7 @@ def __create_vm_instances(os_creds_dict, os_users_dict, instances_config, if image_dict: image_creator = image_dict.get(conf.get('imageName')) if image_creator: - instance_settings = VmInstanceSettings( + instance_settings = VmInstanceConfig( **instance_config['instance']) kp_creator = keypairs_dict.get( conf.get('keypair_name')) |