FA: fixed oslo config autogeneration

CONF initialization is moved into method.
Autogeneration script does not work when
CONF is initialized in global scope.

Closes-Bug: #1472576
Change-Id: I7810d0befb0f8006592299424af1b773066785e3
This commit is contained in:
Vladimir Kozhukalov 2015-07-08 14:10:19 +03:00
parent 06c936d5ad
commit 0f46753eed
1 changed files with 7 additions and 5 deletions

View File

@ -37,11 +37,6 @@ cli_opts = [
CONF = cfg.CONF
CONF.register_cli_opts(cli_opts)
CONF(sys.argv[1:], project='fuel-agent',
version=version.version_info.release_string())
logging.setup('fuel-agent')
LOG = logging.getLogger(__name__)
def provision():
@ -74,6 +69,7 @@ def print_err(line):
def handle_exception(exc):
LOG = logging.getLogger(__name__)
LOG.exception(exc)
print_err('Unexpected error')
print_err(exc)
@ -81,6 +77,12 @@ def handle_exception(exc):
def main(actions=None):
CONF(sys.argv[1:], project='fuel-agent',
version=version.version_info.release_string())
logging.setup('fuel-agent')
LOG = logging.getLogger(__name__)
try:
if CONF.input_data:
data = json.loads(CONF.input_data)