Change in vdsm[master]: caps: Ensure package version data are always strings
danken at redhat.com
danken at redhat.com
Tue Feb 5 06:31:53 UTC 2013
Dan Kenigsberg has posted comments on this change.
Change subject: caps: Ensure package version data are always strings
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(2 inline comments)
....................................................
File vdsm/caps.py
Line 319: ver, rel = '0', '0'
Line 320: try:
Line 321: t = file('/proc/sys/kernel/version').read().split()[2:]
Line 322: del t[4] # Delete timezone
Line 323: t = str(time.mktime(time.strptime(' '.join(t))))
str() is indeed needed here - but I actualy think we need str(int()) to avoid long insignificant floating point representation.
Line 324: except:
Line 325: logging.error('kernel build time not found', exc_info=True)
Line 326: t = '0'
Line 327: return dict(version=ver, release=rel, buildtime=t)
Line 342: logging.debug("rpm package %s not found", pkg)
Line 343: else:
Line 344: pkgs[pkg] = {
Line 345: 'version': str(mi['version']),
Line 346: 'release': str(mi['release']),
I'm pretty sure that the str() calls for version and release are redundant. do we really need them?
Line 347: 'buildtime': str(mi['buildtime']),
Line 348: }
Line 349: except:
Line 350: logging.error('', exc_info=True)
--
To view, visit http://gerrit.ovirt.org/11569
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I506d2b5edacd85c5540a040ce0ff5fe40c12b352
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <agl at us.ibm.com>
Gerrit-Reviewer: Adam Litke <agl at us.ibm.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list