diff options
author | Alex Yang <yangyang1@zte.com.cn> | 2017-06-27 10:02:36 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-06-27 10:02:36 +0000 |
commit | 1fd049a5a3f22d629c3eada67e39081aded8d161 (patch) | |
tree | bc6a6567e30a96c6727d625388ee2c7e51ac87ed /deploy/environment.py | |
parent | 759e1d6f490e8683041040d6845b2bf7409f9520 (diff) | |
parent | 180cda99be47c1c4cc05844fb8feeeed96e0f3aa (diff) |
Merge "Adapt the scenario arg add in tempset.py"
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): |