Update rootwrap with code from oslo.
Change-Id: I30f1b8773840c098f1e38d09bf13f0863035289e
This commit is contained in:
@@ -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()
|
||||
|
8
nova/cmd/rootwrap.py → nova/openstack/common/rootwrap/cmd.py
Normal file → Executable file
8
nova/cmd/rootwrap.py → nova/openstack/common/rootwrap/cmd.py
Normal file → Executable file
@@ -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
|
||||
|
Reference in New Issue
Block a user