Skip to content

Commit c585603

Browse files
committed
Log configuration options on start-up
This is very convenient for debugging and is something ironic and ironic-inspector already do. Register SSL options earlier so that they're accounted for. Change-Id: I56aca8eec1dfeb065ac657452a7076a9e3d17cc3
1 parent 1f590ea commit c585603

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

ironic_python_agent/api/app.py

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

1717
from ironic_lib import metrics_utils
1818
from oslo_log import log
19-
from oslo_service import sslutils
2019
from oslo_service import wsgi
2120
import werkzeug
2221
from werkzeug import exceptions as http_exc
@@ -130,7 +129,6 @@ def __call__(self, environ, start_response):
130129
def start(self, tls_cert_file=None, tls_key_file=None):
131130
"""Start the API service in the background."""
132131
if tls_cert_file and tls_key_file:
133-
sslutils.register_opts(self._conf)
134132
self._conf.set_override('cert_file', tls_cert_file, group='ssl')
135133
self._conf.set_override('key_file', tls_key_file, group='ssl')
136134
use_tls = True

ironic_python_agent/cmd/agent.py

Lines changed: 8 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_service import sslutils
1920
from oslo_utils import strutils
2021

2122
from ironic_python_agent import agent
@@ -34,6 +35,13 @@ def run():
3435
ipa_debug = strutils.bool_from_string(ipa_debug)
3536
CONF.set_override('debug', ipa_debug)
3637
log.setup(CONF, 'ironic-python-agent')
38+
# Used for TLS configuration
39+
sslutils.register_opts(CONF)
40+
41+
logger = log.getLogger(__name__)
42+
logger.debug("Configuration:")
43+
CONF.log_opt_values(logger, log.DEBUG)
44+
3745
agent.IronicPythonAgent(CONF.api_url,
3846
agent.Host(hostname=CONF.advertise_host,
3947
port=CONF.advertise_port),

ironic_python_agent/tests/unit/test_agent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from oslo_concurrency import processutils
2121
from oslo_config import cfg
2222
from oslo_serialization import jsonutils
23+
from oslo_service import sslutils
2324
import pkg_resources
2425
from stevedore import extension
2526

@@ -837,6 +838,7 @@ class TestAgentStandalone(ironic_agent_base.IronicAgentTest):
837838

838839
def setUp(self):
839840
super(TestAgentStandalone, self).setUp()
841+
sslutils.register_opts(CONF)
840842
self.agent = agent.IronicPythonAgent('https://fake_api.example.'
841843
'org:8081/',
842844
agent.Host(hostname='203.0.113.1',

0 commit comments

Comments
 (0)