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.