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
This commit is contained in:
Dmitry Tantsur 2020-01-20 16:00:50 +01:00
parent 0a94391e34
commit 2bf981982c
2 changed files with 7 additions and 3 deletions

View File

@ -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 '

View File

@ -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.