Merge "Fix ipaddress issues in the infinidat driver"

This commit is contained in:
Zuul 2021-07-02 00:54:34 +00:00 committed by Gerrit Code Review
commit b8be5f7f11
2 changed files with 7 additions and 1 deletions

View File

@ -330,7 +330,7 @@ class InfiniboxShareDriver(driver.ShareDriver):
# try treating the ip_address parameter as a range of IP addresses:
ip_network = ipaddress.ip_network(ip_address, strict=False)
ip_network_hosts = list(ip_network.hosts())
if len(ip_network_hosts) == 0: # /32, single IP address
if len(ip_network_hosts) < 2: # /32, single IP address
return ip_address.split('/')[0]
return "{}-{}".format(ip_network_hosts[0], ip_network_hosts[-1])

View File

@ -0,0 +1,6 @@
---
fixes:
- |
The Infinidat driver's been fixed to process single IP Addresses (/32)
correctly. See `bug 1934345 <https://launchpad.net/bugs/1934345>`_ for
more details.