mirror of
https://github.com/munki/munki.git
synced 2026-04-23 21:40:25 -05:00
In munkicommon.comparePlistVersion, protect against a plist parsing as NSCFString, not NSCFDictionary as expected, avoiding the following traceback:
File "/usr/local/munki/managedsoftwareupdate", line 664, in main updatecheckresult = updatecheck.check(client_id=options.id) File "/usr/local/munki/munkilib/updatecheck.py", line 2777, in check installinfo) File "/usr/local/munki/munkilib/updatecheck.py", line 2071, in processManifestForKey processOptionalInstall(item, cataloglist, installinfo) File "/usr/local/munki/munkilib/updatecheck.py", line 1565, in processOptionalInstall iteminfo['installed'] = someVersionInstalled(item_pl) File "/usr/local/munki/munkilib/updatecheck.py", line 1281, in someVersionInstalled if compareItemVersion(item) == 0: File "/usr/local/munki/munkilib/updatecheck.py", line 645, in compareItemVersion return compareApplicationVersion(item) File "/usr/local/munki/munkilib/updatecheck.py", line 400, in compareApplicationVersion return compareBundleVersion(app) File "/usr/local/munki/munkilib/updatecheck.py", line 517, in compareBundleVersion compare_result = comparePlistVersion(item) File "/usr/local/munki/munkilib/updatecheck.py", line 562, in comparePlistVersion installedvers = munkicommon.getVersionString(plist) File "/usr/local/munki/munkilib/munkicommon.py", line 1345, in getVersionString if plist.get(key): AttributeError: '__NSCFString' object has no attribute 'get'
This commit is contained in:
committed by
Greg Neagle
parent
12e9af2724
commit
80746ac975
@@ -549,6 +549,10 @@ def comparePlistVersion(item):
|
||||
except FoundationPlist.NSPropertyListSerializationException:
|
||||
munkicommon.display_debug1('\t%s may not be a plist!', filepath)
|
||||
return 0
|
||||
if not hasattr(plist, 'get'):
|
||||
munkicommon.display_debug1(
|
||||
'plist not parsed as NSCFDictionary: %s', filepath)
|
||||
return 0
|
||||
|
||||
if 'version_comparison_key' in item:
|
||||
# specific key has been supplied,
|
||||
|
||||
Reference in New Issue
Block a user