diff options
author | wu.zhihui <wu.zhihui1@zte.com.cn> | 2016-10-08 16:16:33 +0800 |
---|---|---|
committer | wu.zhihui <wu.zhihui1@zte.com.cn> | 2016-10-09 09:29:03 +0800 |
commit | 9c5468b5c14730b2e72fac736115eb2184a402c6 (patch) | |
tree | 1565c16d10c8698b8b1b06e483289437bd3eec73 /func/spawn_vm.py | |
parent | 62023f676d9801d53dfc1525bebb45f4e88f6fc4 (diff) |
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 <wu.zhihui1@zte.com.cn>
Diffstat (limited to 'func/spawn_vm.py')
-rw-r--r-- | func/spawn_vm.py | 9 |
1 files changed, 6 insertions, 3 deletions
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)
|