Make nova-rootwrap optional
Make the use of nova-rootwrap optional if the current process's effective user id is already root. Change-Id: I2cf5c743c6f4d6f235a54ca70c11d8191deeed6a
This commit is contained in:
@@ -160,7 +160,7 @@ def execute(*cmd, **kwargs):
|
||||
raise exception.NovaException(_('Got unknown keyword args '
|
||||
'to utils.execute: %r') % kwargs)
|
||||
|
||||
if run_as_root:
|
||||
if run_as_root and os.geteuid() != 0:
|
||||
cmd = ['sudo', 'nova-rootwrap', FLAGS.rootwrap_config] + list(cmd)
|
||||
|
||||
cmd = map(str, cmd)
|
||||
|
||||
Reference in New Issue
Block a user