aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/environments/virtual_fuel.py
diff options
context:
space:
mode:
authorPeter Barabas <peter.barabas@ericsson.com>2015-12-08 13:05:57 +0100
committerPeter Barabas <peter.barabas@ericsson.com>2015-12-08 13:05:57 +0100
commitfaecd53622b233f72961ce626ef70788b8a12562 (patch)
treeb693dfa9b8f5cb07f004cb420a1f7c0aa9c5fd4e /deploy/environments/virtual_fuel.py
parent8b7b4f8bde98b05ee68dbed04fa2861bbaaebc22 (diff)
Refactor temporary directory creation
Use Python's tempfile instead of forking a shell for mktemp. Change-Id: Icba442ea08d4098d67fb51575da16e85d4363beb Signed-off-by: Peter Barabas <peter.barabas@ericsson.com>
Diffstat (limited to 'deploy/environments/virtual_fuel.py')
-rw-r--r--deploy/environments/virtual_fuel.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/deploy/environments/virtual_fuel.py b/deploy/environments/virtual_fuel.py
index 705eee48b..89a82c078 100644
--- a/deploy/environments/virtual_fuel.py
+++ b/deploy/environments/virtual_fuel.py
@@ -10,6 +10,7 @@
from lxml import etree
from execution_environment import ExecutionEnvironment
+import tempfile
from common import (
exec_cmd,
@@ -45,7 +46,7 @@ class VirtualFuel(ExecutionEnvironment):
vm_xml.write(f, pretty_print=True, xml_declaration=True)
def create_vm(self):
- temp_dir = exec_cmd('mktemp -d')
+ temp_dir = tempfile.mkdtemp()
vm_name = self.dha.get_node_property(self.fuel_node_id, 'libvirtName')
vm_template = '%s/%s' % (self.root_dir,
self.dha.get_node_property(