Merge pull request #38913 from Adaephon-GH/patch-1

Ignore plist files without Label key
This commit is contained in:
Mike Place 2017-01-25 12:07:26 -07:00 committed by GitHub
commit 953a20350a

View file

@ -103,11 +103,17 @@ def _available_services():
plist = plistlib.readPlistFromBytes(
salt.utils.to_bytes(plist_xml))
available_services[plist.Label.lower()] = {
'filename': filename,
'file_path': true_path,
'plist': plist,
}
try:
available_services[plist.Label.lower()] = {
'filename': filename,
'file_path': true_path,
'plist': plist,
}
except AttributeError:
# As of MacOS 10.12 there might be plist files without Label key
# in the searched directories. As these files do not represent
# services, thay are not added to the list.
pass
return available_services