summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-05-02 10:26:37 -0400
committerMonty Taylor <mordred@inaugust.com>2013-05-09 10:54:01 -0400
commit9c5890cb780587a895a4ac6680dbb4306c30e56f (patch)
treeaa8f2807f3d23c1d70a6abd3210b2e662cc7a878
parent33b966771b672996a7b0d9608f1f7b8684cc459f (diff)
downloadnova-9c5890cb780587a895a4ac6680dbb4306c30e56f.tar.gz
nova-9c5890cb780587a895a4ac6680dbb4306c30e56f.tar.xz
nova-9c5890cb780587a895a4ac6680dbb4306c30e56f.zip
Update rootwrap with code from oslo.
Change-Id: I30f1b8773840c098f1e38d09bf13f0863035289e
-rwxr-xr-xbin/nova-rootwrap4
-rwxr-xr-x[-rw-r--r--]nova/openstack/common/rootwrap/cmd.py (renamed from nova/cmd/rootwrap.py)8
-rw-r--r--setup.cfg2
3 files changed, 8 insertions, 6 deletions
diff --git a/bin/nova-rootwrap b/bin/nova-rootwrap
index f37958ba5..5e3c4fa23 100755
--- a/bin/nova-rootwrap
+++ b/bin/nova-rootwrap
@@ -17,6 +17,6 @@
# limitations under the License.
# Temporary shim to do a devstack transition
-from nova.cmd import rootwrap
+from nova.openstack.common.rootwrap import cmd
-rootwrap.main()
+cmd.main()
diff --git a/nova/cmd/rootwrap.py b/nova/openstack/common/rootwrap/cmd.py
index 0b7d0064f..36d87d4db 100644..100755
--- a/nova/cmd/rootwrap.py
+++ b/nova/openstack/common/rootwrap/cmd.py
@@ -33,6 +33,8 @@
they are needed, to avoid allowing more than is necessary.
"""
+from __future__ import print_function
+
import ConfigParser
import logging
import os
@@ -55,10 +57,10 @@ def _subprocess_setup():
def _exit_error(execname, message, errorcode, log=True):
- print "%s: %s" % (execname, message)
+ print("%s: %s" % (execname, message))
if log:
logging.error(message)
- return(errorcode)
+ sys.exit(errorcode)
def main():
@@ -115,7 +117,7 @@ def main():
preexec_fn=_subprocess_setup,
env=filtermatch.get_environment(userargs))
obj.wait()
- return(obj.returncode)
+ sys.exit(obj.returncode)
except wrapper.FilterMatchNotExecutable as exc:
msg = ("Executable not found: %s (filter match = %s)"
diff --git a/setup.cfg b/setup.cfg
index 9195497bd..aa9371ecb 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -48,7 +48,7 @@ console_scripts =
nova-network = nova.cmd.network:main
nova-novncproxy = nova.cmd.novncproxy:main
nova-objectstore = nova.cmd.objectstore:main
- nova-rootwrap = nova.cmd.rootwrap:main
+ nova-rootwrap = nova.openstack.common.rootwrap.cmd:main
nova-scheduler = nova.cmd.scheduler:main
nova-spicehtml5proxy = nova.cmd.spicehtml5proxy:main
nova-xvpvncproxy = nova.cmd.xvpvncproxy:main