Re-run nova-manage under sudo if unable to read conffile

Having to manually sudo to the nova user to make things work is
tedious. Make it so that if we can't read the conffile, we just
re-exec under sudo.

Fixes bug 805695

Change-Id: I322cece80ca757c69147fb3f8474ad137d9bff82
This commit is contained in:
Soren Hansen 2012-02-04 00:02:41 +01:00
parent 9522ec7943
commit 7603fbc93a

@ -325,7 +325,7 @@ def default_flagfile(filename='nova.conf', args=None):
args = sys.argv
for arg in args:
if arg.find('flagfile') != -1:
break
return arg[arg.index('flagfile') + 1:]
else:
if not os.path.isabs(filename):
# turn relative filename into an absolute path
@ -338,6 +338,7 @@ def default_flagfile(filename='nova.conf', args=None):
if os.path.exists(filename):
flagfile = '--flagfile=%s' % filename
args.insert(1, flagfile)
return filename
def debug(arg):