diff options
| author | Jay Faulkner <jay.faulkner@verizonmedia.com> | 2020-08-28 15:25:36 -0700 |
|---|---|---|
| committer | Julia Kreger <juliaashleykreger@gmail.com> | 2020-09-02 21:56:46 +0000 |
| commit | 2e8d36fc405ef2a58f273d107e506e846d054d78 (patch) | |
| tree | 7018943873720505740dccc60b045fbc3af752b9 /ironic_python_agent/api/app.py | |
| parent | 86cf092f887834d3c4b2abb47be5ad12ae4aace8 (diff) | |
| download | ironic-python-agent-bugfix/6.2.tar.gz | |
Make WSGI server respect listen_* directivesbugfix/6.2-eolbugfix/6.2
The listen_port and listen_host directives are intended to allow
deployers of IPA to change the port and host IPA listens on. These
configs have not been obeyed since the migration to the oslo.service
wsgi server.
Story: 2008016
Task: 40668
Change-Id: I76235a6e6ffdf80a0f5476f577b055223cdf1585
(cherry picked from commit 7d0ad36ebd350a7162bc3c33bbefd26b9e962a78)
Diffstat (limited to 'ironic_python_agent/api/app.py')
| -rw-r--r-- | ironic_python_agent/api/app.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ironic_python_agent/api/app.py b/ironic_python_agent/api/app.py index 28ed03b2..a4575ce7 100644 --- a/ironic_python_agent/api/app.py +++ b/ironic_python_agent/api/app.py @@ -23,7 +23,6 @@ from werkzeug import routing from werkzeug.wrappers import json as http_json from ironic_python_agent import encoding -from ironic_python_agent import netutils LOG = log.getLogger(__name__) @@ -86,8 +85,6 @@ def format_exception(value): class Application(object): - PORT = 9999 - def __init__(self, agent, conf): """Set up the API app. @@ -132,10 +129,11 @@ class Application(object): def start(self): """Start the API service in the background.""" self.service = wsgi.Server(self._conf, 'ironic-python-agent', app=self, - host=netutils.get_wildcard_address(), - port=self.PORT) + host=self.agent.listen_address.hostname, + port=self.agent.listen_address.port) self.service.start() - LOG.info('Started API service on port %s', self.PORT) + LOG.info('Started API service on port %s', + self.agent.listen_address.port) def stop(self): """Stop the API service.""" @@ -144,7 +142,8 @@ class Application(object): return self.service.stop() self.service = None - LOG.info('Stopped API service on port %s', self.PORT) + LOG.info('Stopped API service on port %s', + self.agent.listen_address.port) def handle_exception(self, environ, exc): """Handle an exception during request processing.""" |
