Speed up non-daemon rootwrap command line invocation
Move the import to the spot where we really need it. This speeds up the command line invocation (non-daemon) a bit. Closes-Bug: #1440744 Change-Id: I401c290e0b61912b5dce106d3fdda91795a8cb12
This commit is contained in:
parent
37b8d376fc
commit
1782ef1444
@ -37,7 +37,6 @@ import sys
|
||||
|
||||
from six import moves
|
||||
|
||||
from oslo_rootwrap import daemon as daemon_mod
|
||||
from oslo_rootwrap import wrapper
|
||||
|
||||
RC_UNAUTHORIZED = 99
|
||||
@ -92,6 +91,10 @@ def main(run_daemon=False):
|
||||
filters = wrapper.load_filters(config.filters_path)
|
||||
|
||||
if run_daemon:
|
||||
# NOTE(dims): When not running as daemon, this import
|
||||
# slows us down just a bit. So moving it here so we have
|
||||
# it only when we need it.
|
||||
from oslo_rootwrap import daemon as daemon_mod
|
||||
daemon_mod.daemon_start(config, filters)
|
||||
else:
|
||||
run_one_command(execname, config, filters, sys.argv)
|
||||
|
Loading…
x
Reference in New Issue
Block a user