From 9c5468b5c14730b2e72fac736115eb2184a402c6 Mon Sep 17 00:00:00 2001 From: "wu.zhihui" Date: Sat, 8 Oct 2016 16:16:33 +0800 Subject: code refactor: create_zones.py 1. simply the process of creating aggregates in create_zones.py. 2. before creating aggregates, it will clean all aggregates firstly. TODO: It should clean up the created aggregates. It needs a big structure modification in args_handler.py. Let's do it step by step. Change-Id: I31e09e917ba83d4676f7f95d9f5186bce8d2a449 Signed-off-by: wu.zhihui --- func/spawn_vm.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'func/spawn_vm.py') diff --git a/func/spawn_vm.py b/func/spawn_vm.py index b467ab1f..5e2c1a70 100644 --- a/func/spawn_vm.py +++ b/func/spawn_vm.py @@ -16,7 +16,7 @@ import heatclient.client import keystoneclient from novaclient import client import time -from func.create_zones import create_zones +from func.create_zones import AvailabilityZone class SpawnVM(Env_setup): @@ -25,6 +25,7 @@ class SpawnVM(Env_setup): def __init__(self, vm_info): print 'SpawnVM Class initiated' + print 'vm_info: %s' % vm_info vm_role_ip_dict = vm_info.copy() print 'Generating Heat Template\n' self._keystone_client = None @@ -32,8 +33,10 @@ class SpawnVM(Env_setup): self._glance_client = None self._nova_client = None self. _get_nova_client() - azoneobj = create_zones() - azoneobj.create_agg(vm_info['availability_zone']) + self.azone = AvailabilityZone() + # TODO: it should clean up aggregates and stack after test case finished. + self.azone.clean_all_aggregates() + self.azone.create_agg(vm_info['availability_zone']) installer = self.get_installer_type() self.Heat_template1 = self.heat_template_vm(vm_info, installer) self.create_stack(vm_role_ip_dict, self.Heat_template1) -- cgit 1.2.3-korg