Files
munki/code
Justin McWilliams 53d16dd778 Fix but in getIdleSeconds() where ioreg output is split, but there are inconsistent number of whitespaces.
I ran into a machine where "parts" was:  ['|', '|', '"HIDIdleTime"', '=', '1458195167613966'], and since parts[3] is "=" getIdleSeconds() was crashing trying to convert it to int().

So return int(int(parts[3])/1000000000) should really be parts[4] on this machine, but this may be inconsistent on different machines?

# /usr/sbin/ioreg -c IOHIDSystem -d 4 | grep Idle
   | |     "HIDIdleTime" = 1458351496253133

So let's just use regex to parse the integer out of the line more safely.



git-svn-id: http://munki.googlecode.com/svn/trunk@1103 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-09 15:10:46 +00:00
..
2011-03-11 13:13:56 +00:00