Change in vdsm[master]: configNetwork: provide IPv6 configuration editing API
Itamar Heim has posted comments on this change. Change subject: configNetwork: provide IPv6 configuration editing API .. Patch Set 1: ping -- To view, visit http://gerrit.ovirt.org/11741 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf39d8cba75e8879a84e83e22a46a4a00eab1384 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Hunt Xu mhun...@gmail.com Gerrit-Reviewer: Antoni Segura Puimedon asegu...@redhat.com Gerrit-Reviewer: Better Saggi bettersa...@gmail.com Gerrit-Reviewer: Itamar Heim ih...@redhat.com Gerrit-Reviewer: Livnat Peer lp...@redhat.com Gerrit-Reviewer: Petr Šebek pse...@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizr...@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: configNetwork: provide IPv6 configuration editing API
Petr Šebek has posted comments on this change. Change subject: configNetwork: provide IPv6 configuration editing API .. Patch Set 1: I believe that this should be abandoned since this patch http://gerrit.ovirt.org/#/c/18284/ is merged. -- To view, visit http://gerrit.ovirt.org/11741 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf39d8cba75e8879a84e83e22a46a4a00eab1384 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Hunt Xu mhun...@gmail.com Gerrit-Reviewer: Antoni Segura Puimedon asegu...@redhat.com Gerrit-Reviewer: Better Saggi bettersa...@gmail.com Gerrit-Reviewer: Itamar Heim ih...@redhat.com Gerrit-Reviewer: Livnat Peer lp...@redhat.com Gerrit-Reviewer: Petr Šebek pse...@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizr...@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: configNetwork: provide IPv6 configuration editing API
Dan Kenigsberg has abandoned this change. Change subject: configNetwork: provide IPv6 configuration editing API .. Abandoned Hunt Xu, thanks a lot for this initiative! Now we should extend it to the Engine! -- To view, visit http://gerrit.ovirt.org/11741 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ibf39d8cba75e8879a84e83e22a46a4a00eab1384 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Hunt Xu mhun...@gmail.com Gerrit-Reviewer: Antoni Segura Puimedon asegu...@redhat.com Gerrit-Reviewer: Better Saggi bettersa...@gmail.com Gerrit-Reviewer: Itamar Heim ih...@redhat.com Gerrit-Reviewer: Livnat Peer lp...@redhat.com Gerrit-Reviewer: Petr Šebek pse...@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizr...@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: configNetwork: provide IPv6 configuration editing API
Hunt Xu has uploaded a new change for review. Change subject: configNetwork: provide IPv6 configuration editing API .. configNetwork: provide IPv6 configuration editing API Change-Id: Ibf39d8cba75e8879a84e83e22a46a4a00eab1384 Signed-off-by: huntxu mhun...@gmail.com --- M vdsm/configNetwork.py M vdsm_api/vdsmapi-schema.json 2 files changed, 157 insertions(+), 19 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/11741/1 diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py index 963528c..4f1be10 100755 --- a/vdsm/configNetwork.py +++ b/vdsm/configNetwork.py @@ -415,7 +415,8 @@ def _createConfFile(self, conf, name, ipaddr=None, netmask=None, gateway=None, bootproto=None, mtu=None, onboot='yes', -**kwargs): +ipv6=False, ipv6addrs=None, ipv6gateway=None, +dhcpv6=False, **kwargs): Create ifcfg-* file with proper fields per device cfg = DEVICE=%s\nONBOOT=%s\n % (pipes.quote(name), @@ -435,6 +436,25 @@ if mtu: cfg = cfg + 'MTU=%d\n' % mtu cfg += 'NM_CONTROLLED=no\n' + +if ipv6: +cfg += 'IPV6INIT=yes\n' +ipv6autoconf = 'no' +if ipv6addrs is not None: +ipv6addrs = ipv6addrs.split(',') +primary = ipv6addrs[0] +secs = ' '.join(ipv6addrs[1:]).strip() +cfg += 'IPV6ADDR=%s\n' % pipes.quote(primary) +if secs: +cfg += 'IPV6ADDR_SECONDARIES=%s\n' % pipes.quote(secs) +if ipv6gateway is not None: +cfg += 'IPV6_DEFAULTGW=%s\n' % pipes.quote(ipv6gateway) +elif dhcpv6: +cfg += 'DHCPV6C=yes\n' +else: +ipv6autoconf = 'yes' +cfg += 'IPV6_AUTOCONF=%s\n' % pipes.quote(ipv6autoconf) + BLACKLIST = ['TYPE', 'NAME', 'DEVICE', 'bondingOptions', 'force', 'blockingdhcp', 'connectivityCheck', 'connectivityTimeout', @@ -489,6 +509,22 @@ if mtu: mtu = int(mtu) +if not utils.tobool(kwargs.get('ipv6', False)): +if confParams.get('IPV6INIT', 'no') == 'yes': +kwargs['ipv6'] = True +kwargs['ipv6gateway'] = confParams.get('IPV6_DEFAULTGW', + None) +kwargs['dhcpv6'] = (confParams.get('DHCPV6C', 'no') +== 'yes') + +primary = confParams.get('IPV6ADDR', '') +secs = confParams.get('IPV6ADDR_SECONDARIES', '') +ipv6addrs = (primary + ' ' + secs).strip() +if len(ipv6addrs) 0: +kwargs['ipv6addrs'] = ','.join(ipv6addrs.split(' ')) +else: +kwargs['ipv6addrs'] = None + self._createConfFile(conf, bonding, ipaddr, netmask, gateway, bootproto, mtu, onboot, **kwargs) @@ -521,6 +557,22 @@ mtu = confParams.get('MTU', None) if mtu: mtu = int(mtu) + +if not utils.tobool(kwargs.get('ipv6', False)): +if confParams.get('IPV6INIT', 'no') == 'yes': +kwargs['ipv6'] = True +kwargs['ipv6gateway'] = confParams.get('IPV6_DEFAULTGW', + None) +kwargs['dhcpv6'] = (confParams.get('DHCPV6C', 'no') +== 'yes') + +primary = confParams.get('IPV6ADDR', '') +secs = confParams.get('IPV6ADDR_SECONDARIES', '') +ipv6addrs = (primary + ' ' + secs).strip() +if len(ipv6addrs) 0: +kwargs['ipv6addrs'] = ','.join(ipv6addrs.split(' ')) +else: +kwargs['ipv6addrs'] = None self._createConfFile(conf, nic, ipaddr, netmask, gateway, bootproto, mtu, onboot, **kwargs) @@ -718,6 +770,37 @@ Bad gateway: %r % gateway) +def _validateIPv6Address(address): +try: +socket.inet_pton(socket.AF_INET6, address) +except socket.error: +return False +return True + + +def validateIPv6Address(addr): +if not _validateIPv6Address(addr): +raise ConfigNetworkError(ne.ERR_BAD_ADDR, + Bad IPv6 address: %r % addr) + + +def validateIPv6Prefixlen(prefixlen): +try: +prefixlen = int(prefixlen) +if prefixlen 0 or prefixlen 127: +raise ConfigNetworkError(ne.ERR_BAD_ADDR, + Bad
Change in vdsm[master]: configNetwork: provide IPv6 configuration editing API
oVirt Jenkins CI Server has posted comments on this change. Change subject: configNetwork: provide IPv6 configuration editing API .. Patch Set 1: Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1137/ (1/3) -- To view, visit http://gerrit.ovirt.org/11741 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf39d8cba75e8879a84e83e22a46a4a00eab1384 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Hunt Xu mhun...@gmail.com Gerrit-Reviewer: oVirt Jenkins CI Server ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: configNetwork: provide IPv6 configuration editing API
oVirt Jenkins CI Server has posted comments on this change. Change subject: configNetwork: provide IPv6 configuration editing API .. Patch Set 1: Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/248/ (2/3) -- To view, visit http://gerrit.ovirt.org/11741 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf39d8cba75e8879a84e83e22a46a4a00eab1384 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Hunt Xu mhun...@gmail.com Gerrit-Reviewer: oVirt Jenkins CI Server ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: configNetwork: provide IPv6 configuration editing API
oVirt Jenkins CI Server has posted comments on this change. Change subject: configNetwork: provide IPv6 configuration editing API .. Patch Set 1: Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1102/ (3/3) -- To view, visit http://gerrit.ovirt.org/11741 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf39d8cba75e8879a84e83e22a46a4a00eab1384 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Hunt Xu mhun...@gmail.com Gerrit-Reviewer: oVirt Jenkins CI Server ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: configNetwork: provide IPv6 configuration editing API
oVirt Jenkins CI Server has posted comments on this change. Change subject: configNetwork: provide IPv6 configuration editing API .. Patch Set 1: Build Successful http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1102/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1137/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/248/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/11741 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf39d8cba75e8879a84e83e22a46a4a00eab1384 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Hunt Xu mhun...@gmail.com Gerrit-Reviewer: oVirt Jenkins CI Server ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches