diff options
author | 2017-06-26 11:16:15 +0800 | |
---|---|---|
committer | 2017-06-27 10:01:28 +0800 | |
commit | 180cda99be47c1c4cc05844fb8feeeed96e0f3aa (patch) | |
tree | d4c4c31aed246ee7b85bd040e2c3d9486eb5657f /deploy/environment.py | |
parent | 7795fc14f129a2c37607aa965d63e5831099681b (diff) |
Adapt the scenario arg add in tempset.py
1.adapt the scenario argument add in tempset.py, detail please
refer to
https://gerrit.opnfv.org/gerrit/#/c/36229/5/deploy/tempest.py.
2.bugfix to update the self.deploy_file with the constructed final
deploy file in deoploy.py.
Change-Id: Ia46720649a2361f0b84749925d2c0dede78ccdb5
Signed-off-by: zhongjun <zhong.jun@zte.com.cn>
Diffstat (limited to 'deploy/environment.py')
-rw-r--r-- | deploy/environment.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/deploy/environment.py b/deploy/environment.py index a6ef4ab5..1cd32980 100644 --- a/deploy/environment.py +++ b/deploy/environment.py @@ -53,20 +53,22 @@ VIRT_NET_TEMPLATE_PATH = path_join(WORKSPACE, 'templates/virtual_environment/net class DaisyEnvironment(object): def __new__(cls, deploy_struct, net_struct, adapter, pxe_bridge, - daisy_server_info, work_dir, storage_dir): + daisy_server_info, work_dir, storage_dir, scenario): if adapter == 'libvirt': return VirtualEnvironment(deploy_struct, net_struct, adapter, pxe_bridge, - daisy_server_info, work_dir, storage_dir) + daisy_server_info, work_dir, + storage_dir, scenario) else: return BareMetalEnvironment(deploy_struct, net_struct, adapter, pxe_bridge, - daisy_server_info, work_dir, storage_dir) + daisy_server_info, work_dir, + storage_dir, scenario) class DaisyEnvironmentBase(object): def __init__(self, deploy_struct, net_struct, adapter, pxe_bridge, - daisy_server_info, work_dir, storage_dir): + daisy_server_info, work_dir, storage_dir, scenario): self.deploy_struct = deploy_struct self.net_struct = net_struct self.adapter = adapter @@ -75,6 +77,7 @@ class DaisyEnvironmentBase(object): self.storage_dir = storage_dir self.daisy_server_info = daisy_server_info self.server = None + self.scenario = scenario LI('Daisy Environment Initialized') def delete_daisy_server(self): @@ -102,13 +105,16 @@ class DaisyEnvironmentBase(object): shutil.move(image, self.daisy_server_info['image']) LI('Daisy Server image is created %s' % self.daisy_server_info['image']) - def install_daisy(self, remote_dir, bin_file): + def install_daisy(self, remote_dir, bin_file, deploy_file_name, net_file_name): self.server = DaisyServer(self.daisy_server_info['name'], self.daisy_server_info['address'], self.daisy_server_info['password'], remote_dir, bin_file, - self.adapter) + self.adapter, + self.scenario, + deploy_file_name, + net_file_name) self.server.connect() self.server.install_daisy() @@ -162,9 +168,9 @@ class BareMetalEnvironment(DaisyEnvironmentBase): class VirtualEnvironment(DaisyEnvironmentBase): def __init__(self, deploy_struct, net_struct, adapter, pxe_bridge, - daisy_server_info, work_dir, storage_dir): + daisy_server_info, work_dir, storage_dir, scenario): super(VirtualEnvironment, self).__init__(deploy_struct, net_struct, adapter, pxe_bridge, - daisy_server_info, work_dir, storage_dir) + daisy_server_info, work_dir, storage_dir, scenario) self.check_configuration() def check_configuration(self): |