IndexError: list index out of range for SystemVersionPlist array
Closed this issue · 5 comments
AndrewSB commented
I'm having this error
PrimaVita:OSXAuditor-master asb$ sudo python osxauditor.py
DEBUG: Mac OS X Obj-C Foundation successfully imported
[INFO] Header
Traceback (most recent call last):
File "osxauditor.py", line 1702, in <module>
Main()
File "osxauditor.py", line 1635, in Main
AuditedSystemVersion = GetAuditedSystemVersion()
File "osxauditor.py", line 1228, in GetAuditedSystemVersion
"PatchVersion": int(SystemVersionPlist["ProductVersion"].split('.')[2])
IndexError: list index out of range
PrimaVita:OSXAuditor-master asb$ sudo /usr/bin/python osxcollector.py
/usr/bin/python: can't open file 'osxcollector.py': [Errno 2] No such file or directory
ccorcos commented
+1
I commented it out and it ran. (but I got another issue later)
I'm running Yosemite btw...
AndrewSB commented
I'm also running Yosemite
Deleted user commented
This worked on Yosemite, update the major version to "1" as my version of OSX is 10.10.
if SystemVersionPlist:
if "ProductName" in SystemVersionPlist: SysVersion = SystemVersionPlist["ProductName"]
if "ProductVersion" in SystemVersionPlist: SysVersion += " " + SystemVersionPlist["ProductVersion"]
if "ProductBuildVersion" in SystemVersionPlist: SysVersion += " build " + SystemVersionPlist["ProductBuildVersion"]
OSX_VERSION = {
"ProductBuildVersion": SystemVersionPlist["ProductBuildVersion"],
"ProductVersion": SystemVersionPlist["ProductVersion"],
"MajorVersion": int(SystemVersionPlist["ProductVersion"].split('.')[1]),
"MinorVersion": int(SystemVersionPlist["ProductVersion"].split('.')[1]),
"PatchVersion": int(SystemVersionPlist["ProductVersion"].split('.')[0])
}
jaredsburrows commented
Thank you for posting this fix!
jipegit commented
Fixed, thanks.