Don't delete package from cache if installation fails. If the package is corrupt, hash/etags should not match the server and it'll redownload. Furthermore, if the install was actually successful regardless of a non-zero installer exit code, the cached package will be downloaded on the next Munki execution after determining that package is no longer needed.

As discussed here: https://groups.google.com/forum/?fromgroups=#!topic/munki-dev/Q5UxFOf6En8
This commit is contained in:
Justin McWilliams
2012-11-29 15:50:40 -05:00
parent 272b496cc8
commit 2cc9bd5f11
+3 -2
View File
@@ -859,7 +859,9 @@ def installWithInfo(
foundagain = True
break
if not foundagain:
# ensure package is not deleted from cache if installation
# fails by checking retcode
if not foundagain and retcode == 0:
# now remove the item from the install cache
# (if it's still there)
itempath = os.path.join(dirpath, current_installer_item)
@@ -1224,4 +1226,3 @@ def run(only_unattended=False):
errcode = IOPMAssertionRelease(no_idle_sleep_assertion_id)
return (removals_need_restart or installs_need_restart)