Revision 98c98ab9

b/lib/hypervisor/hv_chroot.py
67 67

  
68 68
  def __init__(self):
69 69
    hv_base.BaseHypervisor.__init__(self)
70
    if not os.path.exists(self._ROOT_DIR):
71
      os.mkdir(self._ROOT_DIR)
72
    if not os.path.isdir(self._ROOT_DIR):
73
      raise HypervisorError("Needed path %s is not a directory" %
74
                            self._ROOT_DIR)
70
    utils.EnsureDirs([(self._ROOT_DIR, constants.RUN_DIRS_MODE)])
75 71

  
76 72
  @staticmethod
77 73
  def _IsDirLive(path):
b/lib/hypervisor/hv_fake.py
46 46

  
47 47
  def __init__(self):
48 48
    hv_base.BaseHypervisor.__init__(self)
49
    if not os.path.exists(self._ROOT_DIR):
50
      os.mkdir(self._ROOT_DIR)
49
    utils.EnsureDirs([(self._ROOT_DIR, constants.RUN_DIRS_MODE)])
51 50

  
52 51
  def ListInstances(self):
53 52
    """Get the list of running instances.

Also available in: Unified diff