Merge branch 'issue814fix' into Munki3dev

This commit is contained in:
Greg Neagle
2017-11-03 14:26:07 -07:00
+9 -2
View File
@@ -460,15 +460,22 @@ def get_primary_manifest_catalogs(client_id='', force_refresh=False):
Returns:
cataloglist: list of catalogs from primary manifest
"""
manifest = None
cataloglist = []
if (force_refresh or
manifestutils.PRIMARY_MANIFEST_TAG
not in manifestutils.manifests()):
# Fetch manifest from repo
manifest = manifestutils.get_primary_manifest(client_id)
try:
manifest = manifestutils.get_primary_manifest(client_id)
except manifestutils.ManifestException:
# can't get "fresh" manifest, fall through and try for cached
pass
# set force_refresh = True so we'll also download any missing catalogs
force_refresh = True
else:
if (not manifest and
manifestutils.PRIMARY_MANIFEST_TAG in manifestutils.manifests()):
# Use cached manifest if available
manifest_dir = os.path.join(
prefs.pref('ManagedInstallDir'), 'manifests')