Ensure instances path is accessible by varying users, ie qemu needs this

This commit is contained in:
Joshua Harlow 2012-03-27 13:54:54 -07:00
parent 48ee64f4ff
commit 09159336f4
2 changed files with 9 additions and 0 deletions

View File

@ -763,6 +763,9 @@ class NovaConfConfigurator(object):
self.tracewriter.dirs_made(*sh.mkdirslist(instances_path))
LOG.debug("Adjusting permissions of instance directory: %s" % (instances_path))
sh.chmod(instances_path, 0777)
with sh.Rooted(True):
# This seems required... (maybe only on RHEL?)
sh.rchmod(sh.dirname(instances_path), 0665)
def _configure_libvirt(self, virt_type, nova_conf):
if virt_type == 'lxc':

View File

@ -285,6 +285,12 @@ def _explode_form_path(path):
return ret_paths
def rchmod(path, perm):
paths = _explode_form_path(path)
for p in paths:
chmod(p, perm)
def in_terminal(check_both=False):
if check_both:
return sys.stdout.isatty() and sys.stderr.isatty()