mirror of
https://github.com/munki/munki.git
synced 2026-03-17 23:50:52 -05:00
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