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)