mirror of
https://github.com/munki/munki.git
synced 2026-04-22 20:48:36 -05:00
If a cached manifest is corrupt, delete it.
This commit is contained in:
@@ -2058,13 +2058,19 @@ def processRemoval(manifestitem, cataloglist, installinfo):
|
||||
|
||||
|
||||
def getManifestData(manifestpath):
|
||||
'''Reads a manifest file, returns a
|
||||
dictionary-like object'''
|
||||
'''Reads a manifest file, returns a dictionary-like object.'''
|
||||
plist = {}
|
||||
try:
|
||||
plist = FoundationPlist.readPlist(manifestpath)
|
||||
except FoundationPlist.NSPropertyListSerializationException:
|
||||
munkicommon.display_error('Could not read plist %s' % manifestpath)
|
||||
munkicommon.display_error('Could not read plist: %s', manifestpath)
|
||||
if os.path.exists(manifestpath):
|
||||
try:
|
||||
os.unlink(manifestpath)
|
||||
except OSError, e:
|
||||
munkicommon.display_error('Failed to delete plist: %s', str(e))
|
||||
else:
|
||||
munkicommon.display_error('plist does not exist.')
|
||||
return plist
|
||||
|
||||
|
||||
@@ -2464,7 +2470,7 @@ def curl(url, destinationpath, onlyifnewer=False, etag=None, resume=False,
|
||||
# Prefer Content-Length header to determine download size,
|
||||
# otherwise fall back to a custom X-Download-Size header.
|
||||
# This is primary for servers that use chunked transfer
|
||||
# encoding, when Content-Length is forbidden by
|
||||
# encoding, when Content-Length is forbidden by
|
||||
# RFC2616 4.4. An example of such a server is
|
||||
# Google App Engine Blobstore.
|
||||
targetsize = (
|
||||
|
||||
Reference in New Issue
Block a user