Change in vdsm[master]: netinfo: Determine bootproto from dhclient's lease files

osvoboda at redhat.com osvoboda at redhat.com
Wed Feb 5 13:38:46 UTC 2014


Ondřej Svoboda has posted comments on this change.

Change subject: netinfo: Determine bootproto from dhclient's lease files
......................................................................


Patch Set 19:

(2 comments)

http://gerrit.ovirt.org/#/c/23098/19/lib/vdsm/netinfo.py
File lib/vdsm/netinfo.py:

Line 552:             'netmask': ipv4netmask}
Line 553: 
Line 554: 
Line 555: def _parseExpiryTime(expiryTime):
Line 556:     if expiryTime.startswith('epoch '):
> This two usages of "epoch " should probably become
Thanks, fixed.
Line 557:         since_epoch = expiryTime[len('epoch '):]
Line 558:         return datetime.fromtimestamp(float(since_epoch))
Line 559:     else:
Line 560:         return datetime.strptime(expiryTime, '%w %Y/%m/%d %H:%M:%S')


Line 568: 
Line 569:     interfaces = set()
Line 570:     insideLease = False
Line 571: 
Line 572:     for line in leaseFile.readlines():
> Do we need to read them all at once? Why can't we just have:
The difference was just that the file was read in an instant but your suggestion makes it cleaner.
Line 573:         if insideLease:
Line 574:             if line.startswith(IFACE) and line.endswith(IFACE_END):
Line 575:                 name = line[len(IFACE):-len(IFACE_END)]
Line 576: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5fbc48a0adf5f40120a72ec2c4cc2fc80b7226b8
Gerrit-PatchSet: 19
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list