Merge "Don't attempt to escalate manila-manage privileges"
This commit is contained in:
commit
1a65c16fab
@ -447,17 +447,9 @@ def main():
|
|||||||
CONF(sys.argv[1:], project='manila',
|
CONF(sys.argv[1:], project='manila',
|
||||||
version=version.version_string())
|
version=version.version_string())
|
||||||
log.setup(CONF, "manila")
|
log.setup(CONF, "manila")
|
||||||
except cfg.ConfigFilesNotFoundError:
|
except cfg.ConfigFilesNotFoundError as e:
|
||||||
cfgfile = CONF.config_file[-1] if CONF.config_file else None
|
cfg_files = e.config_files
|
||||||
if cfgfile and not os.access(cfgfile, os.R_OK):
|
print(_("Failed to read configuration file(s): %s") % cfg_files)
|
||||||
st = os.stat(cfgfile)
|
|
||||||
print(_("Could not read %s. Re-running with sudo") % cfgfile)
|
|
||||||
try:
|
|
||||||
os.execvp('sudo', ['sudo', '-u', '#%s' % st.st_uid] + sys.argv)
|
|
||||||
except Exception:
|
|
||||||
print(_('sudo failed, continuing as if nothing happened'))
|
|
||||||
|
|
||||||
print(_('Please re-run manila-manage as root.'))
|
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
fn = CONF.category.action_fn
|
fn = CONF.category.action_fn
|
||||||
|
Loading…
x
Reference in New Issue
Block a user