From 2bf981982cd14825d10568e5cd80f90cfe4f0aae Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Mon, 20 Jan 2020 16:00:50 +0100 Subject: [PATCH] Fix incorrect ibmc_address parsing on Python 3.8 The urlsplit function has changed its semantics somewhere between Python 3.6 and 3.8, resulting in ibmc_address=host:port no longer being accepted. This change fixes it by taking a more dumb approach to handling the default schema. Story: #2007033 Task: #37836 Change-Id: I78b0c62c2291b5a30a6d1f32140eca3a607bfac2 --- ironic/drivers/modules/ibmc/utils.py | 5 ++--- releasenotes/notes/ibmc-38-169438974508f62e.yaml | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/ibmc-38-169438974508f62e.yaml diff --git a/ironic/drivers/modules/ibmc/utils.py b/ironic/drivers/modules/ibmc/utils.py index ebe6944407..0819d7874c 100644 --- a/ironic/drivers/modules/ibmc/utils.py +++ b/ironic/drivers/modules/ibmc/utils.py @@ -77,11 +77,10 @@ def parse_driver_info(node): # Validate the iBMC address address = driver_info['ibmc_address'] - parsed = netutils.urlsplit(address) - if not parsed.scheme: + if '://' not in address: address = 'https://%s' % address - parsed = netutils.urlsplit(address) + parsed = netutils.urlsplit(address) if not parsed.netloc: raise exception.InvalidParameterValue( _('Invalid iBMC address %(address)s set in ' diff --git a/releasenotes/notes/ibmc-38-169438974508f62e.yaml b/releasenotes/notes/ibmc-38-169438974508f62e.yaml new file mode 100644 index 0000000000..1d8fac5c1c --- /dev/null +++ b/releasenotes/notes/ibmc-38-169438974508f62e.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes incorrect parsing of ``ibmc_address`` with a port but without + a schema in the ``ibmc`` hardware type on Python 3.8.