Alon Bar-Lev has posted comments on this change.
Change subject: packaging: setup: correctly verify local IPv6 addresses
......................................................................
Patch Set 1: Code-Review-1
(2 comments)
this code will work also if only ipv6 exists, while vdsm does not support ipv6
only.
....................................................
File packaging/setup/plugins/ovirt-engine-setup/config/hostname.py
Line 129: super(Plugin, self).__init__(context=context)
Line 130:
Line 131: def _is_valid_IPv6_address(self, address):
Line 132: # We do not use a regexp to validate an IPv6 address
Line 133: # because it's too complex. Simply use the library for that.
I prefer single return
ret = False
try:
aaaa
ret = True
except ..:
pass
return ret
Line 134: try:
Line 135: socket.inet_pton(socket.AF_INET6, address)
Line 136: except socket.error:
Line 137: return False
Line 145: self.command.get('ip'),
Line 146: 'addr',
Line 147: ),
Line 148: )
Line 149: currentinterface = ''
why do we need to store the interface between iterations? oh... in ipv6 they
broke the contract of each line has its interface. bad.
Line 150: for line in stdout:
Line 151: interfacematch = self._INTERFACE_RE.match(line)
Line 152: addressmatch = self._ADDRESS_RE.match(line)
Line 153: v6addressmatch = self._IPV6_ADDRESS_RE.match(line)
--
To view, visit http://gerrit.ovirt.org/21709
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I4f4bffdb083755c60704f436a24a960848fbd056
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Yedidyah Bar David <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches