Cleanup exception handling.

git-svn-id: http://munki.googlecode.com/svn/trunk@361 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2009-11-18 05:32:36 +00:00
parent 79148660d9
commit ebf9088150

View File

@@ -579,13 +579,16 @@ def run():
if os.path.exists(installinfo):
try:
pl = FoundationPlist.readPlist(installinfo)
except:
except FoundationPlist.NSPropertyListSerializationException:
print >>sys.stderr, "Invalid %s" % installinfo
return -1
# remove the install info file
# it's no longer valid once we start running
os.unlink(installinfo)
try:
os.unlink(installinfo)
except (OSError, IOError):
munkicommon.display_warning("Could not remove %s" % installinfo)
if "removals" in pl:
# filter list to items that need to be removed