From ed3d93eb9b1a8f5513297d00cbf6bf4bbff49316 Mon Sep 17 00:00:00 2001 From: Ben Swartzlander Date: Sat, 23 Sep 2017 20:34:58 -0400 Subject: [PATCH] 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 --- manila/share/drivers/netapp/dataontap/client/api.py | 6 ++++-- .../bug-1730509-netapp-ipv6-hostname-39abc7f40d48c844.yaml | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/bug-1730509-netapp-ipv6-hostname-39abc7f40d48c844.yaml diff --git a/manila/share/drivers/netapp/dataontap/client/api.py b/manila/share/drivers/netapp/dataontap/client/api.py index d811435372..c446c797b2 100644 --- a/manila/share/drivers/netapp/dataontap/client/api.py +++ b/manila/share/drivers/netapp/dataontap/client/api.py @@ -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: diff --git a/releasenotes/notes/bug-1730509-netapp-ipv6-hostname-39abc7f40d48c844.yaml b/releasenotes/notes/bug-1730509-netapp-ipv6-hostname-39abc7f40d48c844.yaml new file mode 100644 index 0000000000..42c1fae20f --- /dev/null +++ b/releasenotes/notes/bug-1730509-netapp-ipv6-hostname-39abc7f40d48c844.yaml @@ -0,0 +1,4 @@ +--- +fixes: + IPv6 addresses are handled corrected when specified + for the netapp_server_hostname driver option.