Skip to content

Commit 1437e15

Browse files
committed
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
1 parent 2e1b6cd commit 1437e15

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

ironic_python_agent/cmd/agent.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from oslo_config import cfg
1818
from oslo_log import log
19+
from oslo_utils import strutils
1920

2021
from ironic_python_agent import agent
2122
from ironic_python_agent import inspector
@@ -122,6 +123,11 @@ def run():
122123
"""Entrypoint for IronicPythonAgent."""
123124
log.register_options(CONF)
124125
CONF(args=sys.argv[1:])
126+
# Debug option comes from oslo.log, allow overriding it via kernel cmdline
127+
ipa_debug = APARAMS.get('ipa-debug')
128+
if ipa_debug is not None:
129+
ipa_debug = strutils.bool_from_string(ipa_debug)
130+
CONF.set_override('debug', ipa_debug)
125131
log.setup(CONF, 'ironic-python-agent')
126132
agent.IronicPythonAgent(CONF.api_url,
127133
(CONF.advertise_host, CONF.advertise_port),
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
features:
3+
- Debug logging can now be enabled by setting "ipa-debug" kernel parameter.

0 commit comments

Comments
 (0)