1 From: Josep Puigdemont <josep.puigdemont@enea.com>
2 Date: Wed, 4 May 2016 14:27:23 +0200
3 Subject: [PATCH] virtual_fuel: make vm_template an attibute
5 Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com>
7 deploy/environments/virtual_fuel.py | 6 +++++-
8 1 file changed, 5 insertions(+), 1 deletion(-)
10 diff --git a/deploy/environments/virtual_fuel.py b/deploy/environments/virtual_fuel.py
11 index f07207f..92a234c 100644
12 --- a/deploy/environments/virtual_fuel.py
13 +++ b/deploy/environments/virtual_fuel.py
14 @@ -46,6 +46,10 @@ class VirtualFuel(ExecutionEnvironment):
15 self.temp_dir = tempfile.mkdtemp()
16 self.vm_name = self.dha.get_node_property(self.fuel_node_id,
18 + self.vm_template = '%s/%s' % (self.root_dir,
19 + self.dha.get_node_property(
20 + self.fuel_node_id, 'libvirtTemplate'))
21 + check_file_exists(self.vm_template)
25 @@ -106,7 +110,7 @@ class VirtualFuel(ExecutionEnvironment):
26 disk_path = self.create_image(disk_path, disk_size)
28 temp_vm_file = '%s/%s' % (self.temp_dir, self.vm_name)
29 - exec_cmd('cp %s %s' % (vm_template, temp_vm_file))
30 + exec_cmd('cp %s %s' % (self.vm_template, temp_vm_file))
31 self.set_vm_nic(temp_vm_file)
32 vm_definition_overwrite = self.dha.get_vm_definition('fuel')
33 self.define_vm(self.vm_name, temp_vm_file, disk_path,