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:
parent
06c936d5ad
commit
0f46753eed
|
@ -37,11 +37,6 @@ cli_opts = [
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
CONF.register_cli_opts(cli_opts)
|
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():
|
def provision():
|
||||||
|
@ -74,6 +69,7 @@ def print_err(line):
|
||||||
|
|
||||||
|
|
||||||
def handle_exception(exc):
|
def handle_exception(exc):
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
LOG.exception(exc)
|
LOG.exception(exc)
|
||||||
print_err('Unexpected error')
|
print_err('Unexpected error')
|
||||||
print_err(exc)
|
print_err(exc)
|
||||||
|
@ -81,6 +77,12 @@ def handle_exception(exc):
|
||||||
|
|
||||||
|
|
||||||
def main(actions=None):
|
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:
|
try:
|
||||||
if CONF.input_data:
|
if CONF.input_data:
|
||||||
data = json.loads(CONF.input_data)
|
data = json.loads(CONF.input_data)
|
||||||
|
|
Loading…
Reference in New Issue