Added "Logout required" messages to the summary at the end of check()

Fixed logic when looking for uninstall info.

Make sure we have both a packageid and a version before we try to add a receipt to the catalog databate receipts table.

git-svn-id: http://munki.googlecode.com/svn/trunk@414 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2009-12-19 05:19:32 +00:00
parent 5a7e380c55
commit 1fd7e22375
+10 -3
View File
@@ -77,7 +77,7 @@ def makeCatalogDB(catalogitems):
# build table of receipts
if 'receipts' in item:
for receipt in item['receipts']:
if 'packageid' in receipt:
if 'packageid' in receipt and 'version' in receipt:
if not receipt['packageid'] in pkgid_table:
pkgid_table[receipt['packageid']] = {}
if not (receipt['version'] in
@@ -1388,7 +1388,7 @@ def processRemoval(manifestitem, cataloglist, installinfo):
# check for uninstall info
# walk through the list of items (sorted newest first)
# and grab the first uninstall method we find.
if 'uninstallable' in item and 'uninstall_method' in item:
if item.get('uninstallable') and 'uninstall_method' in item:
uninstallmethod = item['uninstall_method']
if uninstallmethod == 'removepackages':
packagesToRemove = getReceiptsToRemove(item)
@@ -2174,6 +2174,10 @@ def check(id=''):
item.get('RestartAction') == 'RecommendRestart':
munkicommon.display_info(" *Restart required")
munkicommon.report['RestartRequired'] = True
if item.get('RestartAction') == 'RequireLogout':
munkicommon.display_info(" *Logout required")
munkicommon.report['LogoutRequired'] = True
if removalcount:
munkicommon.display_info("The following items will be removed:")
for item in installinfo['removals']:
@@ -2183,7 +2187,10 @@ def check(id=''):
item.get('RestartAction') == 'RecommendRestart':
munkicommon.display_info(" *Restart required")
munkicommon.report['RestartRequired'] = True
if item.get('RestartAction') == 'RequireLogout':
munkicommon.display_info(" *Logout required")
munkicommon.report['LogoutRequired'] = True
if installcount == 0 and removalcount == 0:
munkicommon.display_info(
"No changes to managed software are available.")