Simone Tiraboschi has posted comments on this change.

Change subject: packaging: setup: let the user configure engine VM networking
......................................................................


Patch Set 18:

(6 comments)

https://gerrit.ovirt.org/#/c/41357/18/src/plugins/ovirt-hosted-engine-setup/vm/cloud_init.py
File src/plugins/ovirt-hosted-engine-setup/vm/cloud_init.py:

Line 153:         ipnetwork = netaddr.IPNetwork(cidr)
Line 154:         ipaddr = netaddr.IPAddress(ip)
Line 155:         if ipaddr in ipnetwork:
Line 156:             return True
Line 157:         return False
> return (ipaddr in ipnetwork)
Done
Line 158: 
Line 159:     def _get_host_dns_configuration(self):
Line 160:         nameservers = []
Line 161:         try:


Line 162:             rconf = open('/etc/resolv.conf', 'r')
Line 163:             lines = rconf.readlines()
Line 164:             for line in lines:
Line 165:                 ip = re.search(
Line 166:                     
r"^\s*nameserver\s(\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b)",
> ipv6? add a TODO comment if not doing now
Adding a comment as for others
Line 167:                     line
Line 168:                 )
Line 169:                 if ip:
Line 170:                     nameservers.append(ip.group(1))


Line 197:                 if static:
Line 198:                     d_ip_cidr = self._getFreeIPAddress(my_ip)
Line 199:                     default_ip = ''
Line 200:                     if d_ip_cidr:
Line 201:                         default_ip = str(d_ip_cidr.ip)
> default_ip = self._getFreeIPAddress(my_ip) or ''
Not really:

I need to get the .ip attribute but I will get an AttributeError exception if 
d_ip_cidr is None
Line 202:                     proposed_ip = self.dialog.queryString(
Line 203:                         name='CLOUDINIT_VM_STATIC_CIDR',
Line 204:                         note=_(
Line 205:                             'Please enter the IP address '


Line 199:                     default_ip = ''
Line 200:                     if d_ip_cidr:
Line 201:                         default_ip = str(d_ip_cidr.ip)
Line 202:                     proposed_ip = self.dialog.queryString(
Line 203:                         name='CLOUDINIT_VM_STATIC_CIDR',
> CLOUDINIT_VM_STATIC_IP_ADDRESS
Done
Line 204:                         note=_(
Line 205:                             'Please enter the IP address '
Line 206:                             'to be used for the engine VM 
[@DEFAULT@]: '
Line 207:                         ),


Line 356:                 dnslist = [d.strip() for d in dns.split(',')]
Line 357:                 if len(dnslist) > 2:
Line 358:                     self.logger.error(
Line 359:                         _(
Line 360:                             'Just two DNS addresses are supported'
> Is it cloud-init? /etc/resolv.conf supports 3
I'd expected 3 too but I tried it without success while it worked with 2.
Cloud-init wants network option in the Debian format: probably is just 
something in the translation.
I'll try to reproduce.
Line 361:                         )
Line 362:                     )
Line 363:                     continue
Line 364:                 all_valid = True


Line 852:                 ]
Line 853:                 meta_data += (
Line 854:                     '    dns-nameservers {dnslist}\n'
Line 855:                 ).format(
Line 856:                     dnslist=' '.join(dnslist)
> I note that you changed the format. I hope this one works...
I got it from there: https://bugzilla.redhat.com/show_bug.cgi?id=1067906

Official cloud-init documentation is really vague on that.
This one seams OK, not sure about other formats.
Line 857:                 )
Line 858:                 if self.environment[
Line 859:                     ohostedcons.CloudInit.INSTANCE_DOMAINNAME
Line 860:                 ]:


-- 
To view, visit https://gerrit.ovirt.org/41357
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic09f4d92e44f1bf810f06ada703e533b8c5e2061
Gerrit-PatchSet: 18
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Simone Tiraboschi <stira...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Lev Veyde <lve...@redhat.com>
Gerrit-Reviewer: Sandro Bonazzola <sbona...@redhat.com>
Gerrit-Reviewer: Simone Tiraboschi <stira...@redhat.com>
Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to