mirror of
https://github.com/munki/munki.git
synced 2026-04-30 09:19:31 -05:00
Make updatecheck more forgiving if admin specifies a "requires" or "update_for" key as a string instead of an array of strings.
git-svn-id: http://munki.googlecode.com/svn/trunk@1188 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
@@ -1267,10 +1267,12 @@ def lookForUpdates(manifestitem, cataloglist):
|
||||
updaters = CATALOG[catalogname]['updaters']
|
||||
# list comprehension coming up...
|
||||
update_items = [catalogitem['name']
|
||||
for catalogitem in updaters
|
||||
if (name in catalogitem.get('update_for',[]) or
|
||||
nameWithVersion in
|
||||
catalogitem.get('update_for',[]))]
|
||||
for catalogitem in updaters
|
||||
if (name in catalogitem.get('update_for', []) or
|
||||
nameWithVersion in
|
||||
catalogitem.get('update_for', []) or
|
||||
name == catalogitem.get('update_for') or
|
||||
nameWithVersion == catalogitem.get('update_for'))]
|
||||
if update_items:
|
||||
update_list.extend(update_items)
|
||||
|
||||
@@ -1474,6 +1476,10 @@ def processInstall(manifestitem, cataloglist, installinfo):
|
||||
|
||||
if 'requires' in item_pl:
|
||||
dependencies = item_pl['requires']
|
||||
# fix things if 'requires' was specified as a string
|
||||
# instead of an array of strings
|
||||
if isinstance(dependencies, basestring):
|
||||
dependencies = [dependencies]
|
||||
for item in dependencies:
|
||||
munkicommon.display_detail('%s-%s requires %s. '
|
||||
'Getting info on %s...' %
|
||||
|
||||
Reference in New Issue
Block a user