MCPcopy
hub / github.com/jipegit/OSXAuditor / GetAuditedSystemVersion

Function GetAuditedSystemVersion

osxauditor.py:1193–1221  ·  view source on GitHub ↗

Simply return the system version

()

Source from the content-addressed store, hash-verified

1191 ParsePackagesDir(os.path.join(ROOT_PATH, 'Applications'))
1192
1193def GetAuditedSystemVersion():
1194 ''' Simply return the system version '''
1195
1196 global OSX_VERSION
1197
1198 SysVersion = 'Unknown system version'
1199 SystemVersionPlist = False
1200
1201 SystemVersionPlist = UniversalReadPlist('/System/Library/CoreServices/SystemVersion.plist')
1202
1203 if SystemVersionPlist:
1204 if 'ProductName' in SystemVersionPlist: SysVersion = SystemVersionPlist['ProductName']
1205 if 'ProductVersion' in SystemVersionPlist: SysVersion += ' ' + SystemVersionPlist['ProductVersion']
1206 if 'ProductBuildVersion' in SystemVersionPlist: SysVersion += ' build ' + SystemVersionPlist['ProductBuildVersion']
1207
1208 ProductVersion = SystemVersionPlist['ProductVersion'].split('.')
1209
1210 OSX_VERSION = {
1211 'ProductBuildVersion': SystemVersionPlist['ProductBuildVersion'],
1212 'ProductVersion': SystemVersionPlist['ProductVersion'],
1213 'MajorVersion': int(ProductVersion[0]),
1214 'MinorVersion': int(ProductVersion[1]),
1215 'PatchVersion': int(ProductVersion[2] if len(ProductVersion) > 2 else 0)
1216 }
1217
1218 else:
1219 PrintAndLog(u'Cannot determine the system version', 'ERROR')
1220
1221 return SysVersion
1222
1223
1224def GetAuditedSystemTimezone():

Callers 1

MainFunction · 0.85

Calls 2

UniversalReadPlistFunction · 0.85
PrintAndLogFunction · 0.85

Tested by

no test coverage detected