Change in vdsm[master]: caps: Ensure package version data are always strings

agl at us.ibm.com agl at us.ibm.com
Tue Feb 5 14:22:39 UTC 2013


Adam Litke has posted comments on this change.

Change subject: caps: Ensure package version data are always strings
......................................................................


Patch Set 2: (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))))
Done
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 am not sure to be honest.  The documentation for the rpm API doesn't state the type of data returned.  The one that actually tripped me up was for the kernel above so I will limit this patch to that part only.
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