Dominik Holler has uploaded a new change for review.
Change subject: network: extended hosttail_join ......................................................................
network: extended hosttail_join
hosttail_join adds square brackets only for literal IPv6 address, which do not have square brackets already.
Change-Id: Ia2236ec963ad67e26c98a76b70341b0f1b75dceb Signed-off-by: Dominik Holler dholler@redhat.com --- M lib/vdsm/common/network/address.py M tests/common/network_test.py 2 files changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/65/65765/1
diff --git a/lib/vdsm/common/network/address.py b/lib/vdsm/common/network/address.py index e49463f..4e21d5cba 100644 --- a/lib/vdsm/common/network/address.py +++ b/lib/vdsm/common/network/address.py @@ -53,7 +53,8 @@
The tail part may be a port or a path (for mount points). """ - if ':' in host: + # check for literal IPv6 address + if ':' in host and not host.startswith('['): host = '[' + host + ']' return host + ':' + tail
diff --git a/tests/common/network_test.py b/tests/common/network_test.py index f586248..4bda38b 100644 --- a/tests/common/network_test.py +++ b/tests/common/network_test.py @@ -77,11 +77,13 @@ # IPv6 ("2001:db8::60fe:5bf:febc:912", "/path", "[2001:db8::60fe:5bf:febc:912]:/path"), + ("[2001:db8::60fe:5bf:febc:912]", "/path", + "[2001:db8::60fe:5bf:febc:912]:/path"),
# Invalid host - concatenation still occurs ("ser:ver", "/path", "[ser:ver]:/path"), - ("[2001:db8::60fe:5bf:febc:912]", "/path", - "[[2001:db8::60fe:5bf:febc:912]]:/path"), + ("/2001:db8::60fe:5bf:febc:912/", "/path", + "[/2001:db8::60fe:5bf:febc:912/]:/path"), ]) def test_hosttail_join(self, host, tail, expected): self.assertEquals(expected, ipaddress.hosttail_join(host, tail))
gerrit-hooks has posted comments on this change.
Change subject: network: extended hosttail_join ......................................................................
Patch Set 1:
* Update Tracker::IGNORE, no bug url/s found * Check Bug-Url::IGNORE, no bug url/s found * Check Public Bug::WARN, no public bug url found * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Dominik Holler has abandoned this change.
Change subject: network: extended hosttail_join ......................................................................
Abandoned
not needed
gerrit-hooks has posted comments on this change.
Change subject: network: extended hosttail_join ......................................................................
Patch Set 1:
* update_tracker: OK
vdsm-patches@lists.fedorahosted.org