Change in vdsm[master]: Change of ConfigWriter._createConfFile parameters

amuller at redhat.com amuller at redhat.com
Thu Aug 22 12:48:39 UTC 2013


Assaf Muller has posted comments on this change.

Change subject: Change of ConfigWriter._createConfFile parameters
......................................................................


Patch Set 2: Verified-1 Code-Review-1

(4 comments)

....................................................
File vdsm/netconf/ifcfg.py
Line 487
Line 488
Line 489
Line 490
Line 491
addBridge gets the defaultRoute value from bridge.ipConfig, where it is kept in the True/False/None format. Before writing to the ifcfg file we need to convert it to the 'yes'/'no'/None format via _toIfcfgFormat. addBonding and addNic get it via the _getIfaceConfValues which already converts the type.


Line 499
Line 500
Line 501
Line 502
Line 503
Same as the addBridge comment.


Line 455:         cfg += """DEVICE=%s\nONBOOT=%s\n""" % (pipes.quote(name),
Line 456:                                                pipes.quote(onboot))
Line 457:         cfg += conf
Line 458:         if ipconfig is not None:
Line 459:             if ipconfig.ipaddr:
The ipconfig object doesn't have an ipaddr attribute. There's some confusion here between netEnt.ip and netEnt.ipConfig I guess.
Line 460:                 cfg = cfg + 'IPADDR=%s\n' % pipes.quote(ipconfig.ipaddr)
Line 461:                 cfg = cfg + 'NETMASK=%s\n' % pipes.quote(ipconfig.netmask)
Line 462:                 if ipconfig.gateway:
Line 463:                     cfg = cfg + 'GATEWAY=%s\n' % pipes.quote(ipconfig.gateway)


Line 524:         ipconfig = self._getIfaceConfValues(nic, _netinfo)
Line 525:         self._createConfFile(conf, nic.name, ipconfig, **opts)
Line 526: 
Line 527:     @staticmethod
Line 528:     def _getIfaceConfValues(iface, _netinfo):
Note that _getIfaceConfValues didn't use to overwrite values, it just returned ipaddr, netmask, ...
Now it overwrites values in iface.ip, but is still called _get, which is kind of confusing.
Line 529:         if iface.ip is None:
Line 530:             iface.ip = IpConfig(IPv4())
Line 531:         defaultRoute = ConfigWriter._toIfcfgFormat(iface.ip.inet.defaultRoute)
Line 532:         mtu = iface.mtu


-- 
To view, visit http://gerrit.ovirt.org/18331
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae5ec15048ed52170371dda1d0fa9b90d51838e3
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Šebek <psebek at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Petr Šebek <psebek at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list