diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-11 00:06:26 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-11 00:06:26 +0000 |
| commit | 260d7efce73d2f175a8f647e61d3ff5b71e0f885 (patch) | |
| tree | 5301fb1074ca595b44348ffd8c39154be03d512b /nova | |
| parent | be9435f1849037ab3e5ba9aa88e7db30ca616459 (diff) | |
| parent | 9c5890cb780587a895a4ac6680dbb4306c30e56f (diff) | |
Merge "Update rootwrap with code from oslo."
Diffstat (limited to 'nova')
| -rwxr-xr-x[-rw-r--r--] | nova/openstack/common/rootwrap/cmd.py (renamed from nova/cmd/rootwrap.py) | 8 |
1 files changed, 5 insertions, 3 deletions
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)" |
