neutron/tools
Terry Wilson 0df884ac93 Add rootwrap daemon mode support
This patch introduces support for rootwrap daemon mode. It adds
a new config option, AGENT.root_helper_daemon with no default. To
enable, set to something like:

root_helper_daemon = sudo neutron-rootwrap-daemon /etc/neutron/rootwrap.conf

The patch currently assumes that the root_helper_daemon value, and specifically
the rootwrap config, will not change once calls to execute() happen. While it
would not be hard to generate a rootwrap daemon client for each new config, I
couldn't think of a legitimate reason to support it and left it out as YAGNI.

This patch does change the behavior of the addl_env argument to create_process
and execute. Previously, an environment dict would be passed to Popen. If
a root helper was used, this environemnt would actually be passed to 'sudo'
which would filter it before passing it to the underlying command. In the case
of daemon mode, this would cause a problem as the enviornment is filtered by
sudo only once, at daemon startup. Any environment variables added at execute
time would then just be passed directly to the underyling command unfiltered.

oslo.rootwrap 1.6.0 fixes this issue by denying the passing of environment
variables to the daemon altogether. Instead, anything using rootwrap and needing
to pass additional environment variables should define an EnvFilter and run the
command with env var=val cmd. utils.execute/create_process have been modified to
run code in this way (which netns.execute already did).

No code in neutron currently uses both run_as_root=True and addl_env, so this
change does not require any change in code or filters.

DocImpact
Implements: blueprint rootwrap-daemon-mode
Change-Id: I567334bb611253c7b9d830d50c5be308a5153baf
2015-03-12 21:12:07 -05:00
..
abandon_old_reviews.sh Add abandon script from nova 2015-01-27 18:53:42 +00:00
clean.sh Rename Quantum to Neutron 2013-07-06 15:02:43 -04:00
coding-checks.sh Add ability to run pylint check on modified files only 2015-03-05 09:24:05 -08:00
configure_for_func_testing.sh Add rootwrap daemon mode support 2015-03-12 21:12:07 -05:00
copy_api_tests_from_tempest.sh Fix tempest api testing 2015-03-09 21:22:24 +00:00
deploy_rootwrap.sh Automate host configuration for functional testing 2015-02-14 05:13:03 +00:00
install_venv.py Remove the useless vim modelines 2014-06-21 15:07:31 +08:00
install_venv_common.py Remove the useless vim modelines 2014-06-21 15:07:31 +08:00
misc-sanity-checks.sh Add script to copy neutron api tests from tempest 2015-03-06 19:57:27 +00:00
pretty_tox.sh Migrate to oslo.concurrency 2015-01-15 21:01:06 +01:00
split.sh Add notes on how to deal with stable branches 2015-01-23 09:36:29 -08:00
with_venv.sh Remove the useless vim modelines 2014-06-21 15:07:31 +08:00