summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-10-25 09:44:06 +0000
committerGerrit Code Review <review@openstack.org>2012-10-25 09:44:06 +0000
commitee0906399ca6d918cc9827fd15be43756a398f2c (patch)
tree1ffabbdf9c386bc61699268f268c39e4f514dc36
parent44b3e4d610e63576540220ae3b52a4eed5dcd57f (diff)
parent0bfdf3dc57ab122db7c9c6c36caf097dc04bde77 (diff)
Merge "Remove deprecated root_helper config"
-rw-r--r--nova/flags.py5
-rw-r--r--nova/utils.py16
2 files changed, 3 insertions, 18 deletions
diff --git a/nova/flags.py b/nova/flags.py
index e9057d8db..d36284961 100644
--- a/nova/flags.py
+++ b/nova/flags.py
@@ -321,11 +321,8 @@ global_opts = [
default=None,
help='The default format an ephemeral_volume will be '
'formatted with on creation.'),
- cfg.StrOpt('root_helper',
- default='sudo',
- help='Deprecated: command to use for running commands as root'),
cfg.StrOpt('rootwrap_config',
- default=None,
+ default="/etc/nova/rootwrap.conf",
help='Path to the rootwrap configuration file to use for '
'running commands as root'),
cfg.StrOpt('network_driver',
diff --git a/nova/utils.py b/nova/utils.py
index d3bbaeef8..43089b0ab 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -47,7 +47,6 @@ from eventlet import greenthread
from eventlet import semaphore
import netaddr
-from nova.common import deprecated
from nova import exception
from nova import flags
from nova.openstack.common import cfg
@@ -136,8 +135,7 @@ def execute(*cmd, **kwargs):
before retrying.
:param attempts: How many times to retry cmd.
:param run_as_root: True | False. Defaults to False. If set to True,
- the command is prefixed by the command specified
- in the root_helper FLAG.
+ the command is run with rootwrap.
:raises exception.NovaException: on receiving unknown arguments
:raises exception.ProcessExecutionError:
@@ -163,18 +161,8 @@ def execute(*cmd, **kwargs):
'to utils.execute: %r') % kwargs)
if run_as_root:
+ cmd = ['sudo', 'nova-rootwrap', FLAGS.rootwrap_config] + list(cmd)
- if FLAGS.rootwrap_config is None or FLAGS.root_helper != 'sudo':
- deprecated.warn(_('The root_helper option (which lets you specify '
- 'a root wrapper different from nova-rootwrap, '
- 'and defaults to using sudo) is now deprecated. '
- 'You should use the rootwrap_config option '
- 'instead.'))
-
- if (FLAGS.rootwrap_config is not None):
- cmd = ['sudo', 'nova-rootwrap', FLAGS.rootwrap_config] + list(cmd)
- else:
- cmd = shlex.split(FLAGS.root_helper) + list(cmd)
cmd = map(str, cmd)
while attempts > 0: