summaryrefslogtreecommitdiffstats
path: root/examples/launch.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/launch.py')
-rw-r--r--examples/launch.py54
1 files changed, 31 insertions, 23 deletions
diff --git a/examples/launch.py b/examples/launch.py
index 88ff420..9320512 100644
--- a/examples/launch.py
+++ b/examples/launch.py
@@ -26,21 +26,29 @@ import os
import yaml
from snaps import file_utils
-from snaps.openstack.create_flavor import FlavorSettings, OpenStackFlavor
-from snaps.openstack.create_image import ImageSettings, OpenStackImage
+from snaps.config.flavor import FlavorConfig
+from snaps.config.image import ImageConfig
+from snaps.config.keypair import KeypairConfig
+from snaps.config.network import PortConfig, NetworkConfig
+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.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 KeypairSettings, OpenStackKeypair
-from snaps.openstack.create_network import (
- PortSettings, NetworkSettings, OpenStackNetwork)
-from snaps.openstack.create_project import OpenStackProject, ProjectSettings
-from snaps.openstack.create_qos import QoSSettings, OpenStackQoS
-from snaps.openstack.create_router import RouterSettings, OpenStackRouter
+from snaps.openstack.create_keypairs import OpenStackKeypair
+from snaps.openstack.create_network import OpenStackNetwork
+from snaps.openstack.create_project import OpenStackProject
+from snaps.openstack.create_qos import OpenStackQoS
+from snaps.openstack.create_router import OpenStackRouter
from snaps.openstack.create_security_group import (
OpenStackSecurityGroup, SecurityGroupSettings)
-from snaps.openstack.create_user import OpenStackUser, UserSettings
-from snaps.openstack.create_volume import OpenStackVolume, VolumeSettings
-from snaps.openstack.create_volume_type import (
- OpenStackVolumeType, VolumeTypeSettings)
+from snaps.openstack.create_user import OpenStackUser
+from snaps.openstack.create_volume import OpenStackVolume
+from snaps.openstack.create_volume_type import OpenStackVolumeType
from snaps.openstack.os_credentials import OSCreds, ProxySettings
from snaps.openstack.utils import deploy_utils
from snaps.provisioning import ansible_utils
@@ -144,7 +152,7 @@ def __parse_ports_config(config):
"""
out = list()
for port_config in config:
- out.append(PortSettings(**port_config.get('port')))
+ out.append(PortConfig(**port_config.get('port')))
return out
@@ -612,13 +620,13 @@ def main(arguments):
try:
# Create projects
projects_dict = __create_instances(
- os_creds_dict, OpenStackProject, ProjectSettings,
+ os_creds_dict, OpenStackProject, ProjectConfig,
os_config.get('projects'), 'project', clean)
creators.append(projects_dict)
# Create users
users_dict = __create_instances(
- os_creds_dict, OpenStackUser, UserSettings,
+ os_creds_dict, OpenStackUser, UserConfig,
os_config.get('users'), 'user', clean)
creators.append(users_dict)
@@ -634,48 +642,48 @@ 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)
# Create QoS specs
qos_dict = __create_instances(
- os_creds_dict, OpenStackQoS, QoSSettings,
+ os_creds_dict, OpenStackQoS, QoSConfig,
os_config.get('qos_specs'), 'qos_spec', clean, users_dict)
creators.append(qos_dict)
# Create volume types
vol_type_dict = __create_instances(
- os_creds_dict, OpenStackVolumeType, VolumeTypeSettings,
+ os_creds_dict, OpenStackVolumeType, VolumeTypeConfig,
os_config.get('volume_types'), 'volume_type', clean,
users_dict)
creators.append(vol_type_dict)
# Create volume types
vol_dict = __create_instances(
- os_creds_dict, OpenStackVolume, VolumeSettings,
+ os_creds_dict, OpenStackVolume, VolumeConfig,
os_config.get('volumes'), 'volume', clean, users_dict)
creators.append(vol_dict)
# Create images
images_dict = __create_instances(
- os_creds_dict, OpenStackImage, ImageSettings,
+ os_creds_dict, OpenStackImage, ImageConfig,
os_config.get('images'), 'image', clean, users_dict)
creators.append(images_dict)
# Create networks
creators.append(__create_instances(
- os_creds_dict, OpenStackNetwork, NetworkSettings,
+ os_creds_dict, OpenStackNetwork, NetworkConfig,
os_config.get('networks'), 'network', clean, users_dict))
# Create routers
creators.append(__create_instances(
- os_creds_dict, OpenStackRouter, RouterSettings,
+ os_creds_dict, OpenStackRouter, RouterConfig,
os_config.get('routers'), 'router', clean, users_dict))
# Create keypairs
keypairs_dict = __create_instances(
- os_creds_dict, OpenStackKeypair, KeypairSettings,
+ os_creds_dict, OpenStackKeypair, KeypairConfig,
os_config.get('keypairs'), 'keypair', clean, users_dict)
creators.append(keypairs_dict)