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
This commit is contained in:
parent
1f590ea382
commit
c585603ee6
ironic_python_agent
@ -16,7 +16,6 @@ import json
|
|||||||
|
|
||||||
from ironic_lib import metrics_utils
|
from ironic_lib import metrics_utils
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from oslo_service import sslutils
|
|
||||||
from oslo_service import wsgi
|
from oslo_service import wsgi
|
||||||
import werkzeug
|
import werkzeug
|
||||||
from werkzeug import exceptions as http_exc
|
from werkzeug import exceptions as http_exc
|
||||||
@ -130,7 +129,6 @@ class Application(object):
|
|||||||
def start(self, tls_cert_file=None, tls_key_file=None):
|
def start(self, tls_cert_file=None, tls_key_file=None):
|
||||||
"""Start the API service in the background."""
|
"""Start the API service in the background."""
|
||||||
if tls_cert_file and tls_key_file:
|
if tls_cert_file and tls_key_file:
|
||||||
sslutils.register_opts(self._conf)
|
|
||||||
self._conf.set_override('cert_file', tls_cert_file, group='ssl')
|
self._conf.set_override('cert_file', tls_cert_file, group='ssl')
|
||||||
self._conf.set_override('key_file', tls_key_file, group='ssl')
|
self._conf.set_override('key_file', tls_key_file, group='ssl')
|
||||||
use_tls = True
|
use_tls = True
|
||||||
|
@ -16,6 +16,7 @@ import sys
|
|||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
from oslo_service import sslutils
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
|
|
||||||
from ironic_python_agent import agent
|
from ironic_python_agent import agent
|
||||||
@ -34,6 +35,13 @@ def run():
|
|||||||
ipa_debug = strutils.bool_from_string(ipa_debug)
|
ipa_debug = strutils.bool_from_string(ipa_debug)
|
||||||
CONF.set_override('debug', ipa_debug)
|
CONF.set_override('debug', ipa_debug)
|
||||||
log.setup(CONF, 'ironic-python-agent')
|
log.setup(CONF, 'ironic-python-agent')
|
||||||
|
# Used for TLS configuration
|
||||||
|
sslutils.register_opts(CONF)
|
||||||
|
|
||||||
|
logger = log.getLogger(__name__)
|
||||||
|
logger.debug("Configuration:")
|
||||||
|
CONF.log_opt_values(logger, log.DEBUG)
|
||||||
|
|
||||||
agent.IronicPythonAgent(CONF.api_url,
|
agent.IronicPythonAgent(CONF.api_url,
|
||||||
agent.Host(hostname=CONF.advertise_host,
|
agent.Host(hostname=CONF.advertise_host,
|
||||||
port=CONF.advertise_port),
|
port=CONF.advertise_port),
|
||||||
|
@ -20,6 +20,7 @@ from ironic_lib import exception as lib_exc
|
|||||||
from oslo_concurrency import processutils
|
from oslo_concurrency import processutils
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
|
from oslo_service import sslutils
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
from stevedore import extension
|
from stevedore import extension
|
||||||
|
|
||||||
@ -837,6 +838,7 @@ class TestAgentStandalone(ironic_agent_base.IronicAgentTest):
|
|||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestAgentStandalone, self).setUp()
|
super(TestAgentStandalone, self).setUp()
|
||||||
|
sslutils.register_opts(CONF)
|
||||||
self.agent = agent.IronicPythonAgent('https://fake_api.example.'
|
self.agent = agent.IronicPythonAgent('https://fake_api.example.'
|
||||||
'org:8081/',
|
'org:8081/',
|
||||||
agent.Host(hostname='203.0.113.1',
|
agent.Host(hostname='203.0.113.1',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user