diff options
-rwxr-xr-x | bin/nova-rootwrap | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | nova/openstack/common/rootwrap/cmd.py (renamed from nova/cmd/rootwrap.py) | 8 | ||||
-rw-r--r-- | setup.cfg | 2 |
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)" @@ -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 |