Commit 9afb67fe authored by Guido Trotter's avatar Guido Trotter
Browse files

Use EnsureDirs in KVM as well.

The KVM hypervisor has also code to ensure a list of directories exist.
Substitute it with our new utils function.

Reviewed-by: iustinp
parent 9dae41ad
...@@ -73,9 +73,8 @@ class KVMHypervisor(hv_base.BaseHypervisor): ...@@ -73,9 +73,8 @@ class KVMHypervisor(hv_base.BaseHypervisor):
hv_base.BaseHypervisor.__init__(self) hv_base.BaseHypervisor.__init__(self)
# Let's make sure the directories we need exist, even if the RUN_DIR lives # Let's make sure the directories we need exist, even if the RUN_DIR lives
# in a tmpfs filesystem or has been otherwise wiped out. # in a tmpfs filesystem or has been otherwise wiped out.
for mydir in self._DIRS: dirs = [(dir, constants.RUN_DIRS_MODE) for dir in self._DIRS]
if not os.path.exists(mydir): utils.EnsureDirs(dirs)
os.mkdir(mydir)
def _InstancePidAlive(self, instance_name): def _InstancePidAlive(self, instance_name):
"""Returns the instance pid and pidfile """Returns the instance pid and pidfile
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment