Martin Polednik has posted comments on this change.
Change subject: osinfo: properly parse kernel compile time
......................................................................
Patch Set 2:
(1 comment)
https://gerrit.ovirt.org/#/c/65059/2/lib/vdsm/osinfo.py
File lib/vdsm/osinfo.py:
Line 189: try:
Line 190: # Kernel version is defined in a following way:
Line 191: # UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
Line 192: # see scripts/mkcompile_h in linux source code.
Line 193: t = ret[3].split()[-6:]
and timestamp has a fixed length I guess?
It's a shell
`date` (without additional arguments) so as long as we're on sane system, yes. (more
of a fixed format than length though)
Line 194: del t[4] # Delete timezone
Line 195: t = time.mktime(time.strptime(' '.join(t)))
Line 196: except ValueError:
Line 197: logging.error('kernel build time not found', exc_info=True)
--
To view, visit
https://gerrit.ovirt.org/65059
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iacc9b0fe5446abd5405db6efff6b7f9f16468bc9
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes