import time
-from snaps.openstack import create_stack
-from snaps.openstack.create_flavor import OpenStackFlavor, FlavorSettings
+import snaps.config.stack as stack_config
+from snaps.config.flavor import FlavorConfig
+from snaps.openstack.create_flavor import OpenStackFlavor
from snaps.openstack.create_image import OpenStackImage
from snaps.openstack.create_instance import OpenStackVmInstance
-from snaps.openstack.create_stack import StackSettings
+from snaps.openstack.create_stack import StackConfig
from snaps.openstack.tests import openstack_tests
from snaps.openstack.tests.os_source_file_test import OSComponentTestCase
from snaps.openstack.utils import (
# Create Flavor
self.flavor_creator = OpenStackFlavor(
self.os_creds,
- FlavorSettings(name=guid + '-flavor', ram=256, disk=10, vcpus=1))
+ FlavorConfig(name=guid + '-flavor', ram=256, disk=10, vcpus=1))
self.flavor_creator.create()
env_values = {'image_name': self.image_creator.image_settings.name,
'inst_name': self.vm_inst_name}
heat_tmplt_path = pkg_resources.resource_filename(
'snaps.openstack.tests.heat', 'test_heat_template.yaml')
- self.stack_settings1 = StackSettings(
+ self.stack_settings1 = StackConfig(
name=stack_name1, template_path=heat_tmplt_path,
env_values=env_values)
- self.stack_settings2 = StackSettings(
+ self.stack_settings2 = StackConfig(
name=stack_name2, template_path=heat_tmplt_path,
env_values=env_values)
self.stack1 = None
'external_net_name': self.ext_net_name}
heat_tmplt_path = pkg_resources.resource_filename(
'snaps.openstack.tests.heat', 'floating_ip_heat_template.yaml')
- stack_settings = StackSettings(
+ stack_settings = StackConfig(
name=stack_name, template_path=heat_tmplt_path,
env_values=env_values)
self.heat_client = heat_utils.heat_client(self.os_creds)
try:
heat_utils.delete_stack(self.heat_client, self.stack)
# Wait until stack deployment has completed
- end_time = time.time() + create_stack.STACK_COMPLETE_TIMEOUT
+ end_time = (time.time() +
+ stack_config.STACK_COMPLETE_TIMEOUT)
is_deleted = False
while time.time() < end_time:
status = heat_utils.get_stack_status(self.heat_client,
self.stack.id)
- if status == create_stack.STATUS_DELETE_COMPLETE:
+ if status == stack_config.STATUS_DELETE_COMPLETE:
is_deleted = True
break
- elif status == create_stack.STATUS_DELETE_FAILED:
+ elif status == stack_config.STATUS_DELETE_FAILED:
is_deleted = False
break
for server in servers:
vm_settings = settings_utils.create_vm_inst_settings(
nova, neutron, server)
- img_settings = settings_utils.determine_image_settings(
+ img_settings = settings_utils.determine_image_config(
glance, server,
[self.image_creator1.image_settings,
self.image_creator2.image_settings])
self.assertIsNotNone(servers)
self.assertEqual(2, len(servers))
- image_settings = settings_utils.determine_image_settings(
+ image_settings = settings_utils.determine_image_config(
glance, servers[0],
[self.image_creator1.image_settings,
self.image_creator2.image_settings])
self.assertEqual(
self.image_creator2.image_settings.name, image_settings.name)
- image_settings = settings_utils.determine_image_settings(
+ image_settings = settings_utils.determine_image_config(
glance, servers[1],
[self.image_creator1.image_settings,
self.image_creator2.image_settings])
self.assertEqual(
self.image_creator2.image_settings.name, image_settings.name)
- self.keypair1_settings = settings_utils.determine_keypair_settings(
+ self.keypair1_settings = settings_utils.determine_keypair_config(
self.heat_client, self.stack, servers[0],
priv_key_key='private_key')
self.assertIsNotNone(self.keypair1_settings)
self.assertEqual(self.keypair_name, self.keypair1_settings.name)
- self.keypair2_settings = settings_utils.determine_keypair_settings(
+ self.keypair2_settings = settings_utils.determine_keypair_config(
self.heat_client, self.stack, servers[1],
priv_key_key='private_key')
self.assertIsNotNone(self.keypair2_settings)
heat_tmplt_path = pkg_resources.resource_filename(
'snaps.openstack.tests.heat', 'router_heat_template.yaml')
- self.stack_settings = StackSettings(
+ self.stack_settings = StackConfig(
name=stack_name, template_path=heat_tmplt_path,
env_values=env_values)
self.stack = None
self.heat_client, self.stack_settings)
# Wait until stack deployment has completed
- end_time = time.time() + create_stack.STACK_COMPLETE_TIMEOUT
+ end_time = time.time() + stack_config.STACK_COMPLETE_TIMEOUT
is_active = False
while time.time() < end_time:
status = heat_utils.get_stack_status(self.heat_client,
self.stack.id)
- if status == create_stack.STATUS_CREATE_COMPLETE:
+ if status == stack_config.STATUS_CREATE_COMPLETE:
is_active = True
break
- elif status == create_stack.STATUS_CREATE_FAILED:
+ elif status == stack_config.STATUS_CREATE_FAILED:
is_active = False
break
heat_tmplt_path = pkg_resources.resource_filename(
'snaps.openstack.tests.heat', 'volume_heat_template.yaml')
- self.stack_settings = StackSettings(
+ self.stack_settings = StackConfig(
name=stack_name, template_path=heat_tmplt_path,
env_values=env_values)
self.stack = None
heat_tmplt_path = pkg_resources.resource_filename(
'snaps.openstack.tests.heat', 'flavor_heat_template.yaml')
- self.stack_settings = StackSettings(
+ self.stack_settings = StackConfig(
name=stack_name, template_path=heat_tmplt_path)
self.stack = None
self.heat_client = heat_utils.heat_client(self.os_creds)
heat_tmplt_path = pkg_resources.resource_filename(
'snaps.openstack.tests.heat', 'keypair_heat_template.yaml')
- self.stack_settings = StackSettings(
+ self.stack_settings = StackConfig(
name=stack_name, template_path=heat_tmplt_path,
env_values=env_values)
self.stack = None
heat_tmplt_path = pkg_resources.resource_filename(
'snaps.openstack.tests.heat', 'security_group_heat_template.yaml')
- self.stack_settings = StackSettings(
+ self.stack_settings = StackConfig(
name=stack_name, template_path=heat_tmplt_path,
env_values=env_values)
self.stack = None
:return: T/F
"""
# Wait until stack deployment has completed
- end_time = time.time() + create_stack.STACK_COMPLETE_TIMEOUT
+ end_time = time.time() + stack_config.STACK_COMPLETE_TIMEOUT
is_active = False
while time.time() < end_time:
status = heat_utils.get_stack_status(heat_cli, stack.id)
- if status == create_stack.STATUS_CREATE_COMPLETE:
+ if status == stack_config.STATUS_CREATE_COMPLETE:
is_active = True
break
- elif status == create_stack.STATUS_CREATE_FAILED:
+ elif status == stack_config.STATUS_CREATE_FAILED:
is_active = False
break