File tree Expand file tree Collapse file tree 6 files changed +26
-3
lines changed
Expand file tree Collapse file tree 6 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 2323from oslo_concurrency import processutils
2424from oslo_config import cfg
2525from oslo_log import log
26+ from oslo_utils import netutils
2627import pkg_resources
2728from six .moves .urllib import parse as urlparse
2829from stevedore import extension
@@ -365,6 +366,10 @@ def run(self):
365366 LOG .error ('Neither ipa-api-url nor inspection_callback_url'
366367 'found, please check your pxe append parameters.' )
367368
369+ if netutils .is_ipv6_enabled ():
370+ # Listens to both IP versions, assuming IPV6_V6ONLY isn't enabled,
371+ # (the default behaviour in linux)
372+ simple_server .WSGIServer .address_family = socket .AF_INET6
368373 wsgi = simple_server .make_server (
369374 self .listen_address .hostname ,
370375 self .listen_address .port ,
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ from ironic_python_agent import netutils
16+
1517# Server Specific Configurations
1618# See https://pecan.readthedocs.org/en/latest/configuration.html#server-configuration # noqa
1719server = {
1820 'port' : '9999' ,
19- 'host' : '0.0.0.0'
21+ 'host' : netutils . get_wildcard_address ()
2022}
2123
2224# Pecan Application Configurations
Original file line number Diff line number Diff line change 1515from oslo_config import cfg
1616
1717from ironic_python_agent import inspector
18+ from ironic_python_agent import netutils
1819from ironic_python_agent import utils
1920
2021CONF = cfg .CONF
3132 'The value must start with either http:// or https://.' ),
3233
3334 cfg .StrOpt ('listen_host' ,
34- default = APARAMS .get ('ipa-listen-host' , '0.0.0.0' ),
35+ default = APARAMS .get ('ipa-listen-host' ,
36+ netutils .get_wildcard_address ()),
37+ sample_default = '::' ,
3538 deprecated_name = 'listen-host' ,
3639 help = 'The IP address to listen on. '
3740 'Can be supplied as "ipa-listen-host" kernel parameter.' ),
Original file line number Diff line number Diff line change @@ -220,3 +220,9 @@ def wrap_ipv6(ip):
220220 if netutils .is_valid_ipv6 (ip ):
221221 return "[%s]" % ip
222222 return ip
223+
224+
225+ def get_wildcard_address ():
226+ if netutils .is_ipv6_enabled ():
227+ return "::"
228+ return "0.0.0.0"
Original file line number Diff line number Diff line change 2424# NOTE(lucasagomes): This import is needed so we can register the
2525# configuration options prior to IPA prior to starting the service
2626from ironic_python_agent import config # noqa
27+ from ironic_python_agent import netutils
2728
2829
2930class FunctionalBase (test_base .BaseTestCase ):
@@ -40,7 +41,8 @@ def setUp(self):
4041 self .agent = agent .IronicPythonAgent (
4142 api_url = 'http://127.0.0.1:6835' ,
4243 advertise_address = agent .Host ('localhost' , 9999 ),
43- listen_address = agent .Host ('0.0.0.0' , int (self .test_port )),
44+ listen_address = agent .Host (netutils .get_wildcard_address (),
45+ int (self .test_port )),
4446 ip_lookup_attempts = 3 ,
4547 ip_lookup_sleep = 10 ,
4648 network_interface = None ,
Original file line number Diff line number Diff line change 1+ ---
2+ fixes :
3+ - If booted into a kernel that supports IPv6 Ironic Python Agent
4+ now listens for connections on both the IPv4 and IPv6 wildcard
5+ address.
You can’t perform that action at this time.
0 commit comments