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:
parent
2e1b6cd0ed
commit
1437e15a1b
@ -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),
|
||||
|
3
releasenotes/notes/ipa-debug-68c86101b1fdc3d9.yaml
Normal file
3
releasenotes/notes/ipa-debug-68c86101b1fdc3d9.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
features:
|
||||
- Debug logging can now be enabled by setting "ipa-debug" kernel parameter.
|
Loading…
Reference in New Issue
Block a user