Allow enabling debug level via kernel cmdline

Adds a new kernel option "ipa-debug" which can be set to "1" or "true" to
enable debug logging.

Change-Id: Iafe9a9b8b718280920005726e0f7e69e3f0a320c
This commit is contained in:
Dmitry Tantsur 2016-02-25 13:54:15 +01:00
parent 2e1b6cd0ed
commit 1437e15a1b
2 changed files with 9 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import sys
from oslo_config import cfg
from oslo_log import log
from oslo_utils import strutils
from ironic_python_agent import agent
from ironic_python_agent import inspector
@ -122,6 +123,11 @@ def run():
"""Entrypoint for IronicPythonAgent."""
log.register_options(CONF)
CONF(args=sys.argv[1:])
# Debug option comes from oslo.log, allow overriding it via kernel cmdline
ipa_debug = APARAMS.get('ipa-debug')
if ipa_debug is not None:
ipa_debug = strutils.bool_from_string(ipa_debug)
CONF.set_override('debug', ipa_debug)
log.setup(CONF, 'ironic-python-agent')
agent.IronicPythonAgent(CONF.api_url,
(CONF.advertise_host, CONF.advertise_port),

View File

@ -0,0 +1,3 @@
---
features:
- Debug logging can now be enabled by setting "ipa-debug" kernel parameter.