Allow ZAPI over IPv6

When an IPv6 literal is specified in manila.conf for the
netapp_hostname option, automatically URL-escape it.

Closes-bug: 1730509

Change-Id: Id55e870066b6a669da83aa6a96f74ea76d6103bd
This commit is contained in:
Ben Swartzlander 2017-09-23 20:34:58 -04:00
parent 5228e6ade7
commit ed3d93eb9b
2 changed files with 8 additions and 2 deletions

View File

@ -324,8 +324,10 @@ class NaServer(object):
return processed_response.get_child_by_name('results')
def _get_url(self):
return '%s://%s:%s/%s' % (self._protocol, self._host, self._port,
self._url)
host = self._host
if ':' in host:
host = '[%s]' % host
return '%s://%s:%s/%s' % (self._protocol, host, self._port, self._url)
def _build_opener(self):
if self._auth_style == NaServer.STYLE_LOGIN_PASSWORD:

View File

@ -0,0 +1,4 @@
---
fixes:
IPv6 addresses are handled corrected when specified
for the netapp_server_hostname driver option.