From e6600115302cc4f48039028e3ef30ff78670532c Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Wed, 14 Jun 2017 14:19:03 -0700 Subject: [PATCH] MSC.app: revert to Munki2 behavior when generating a list of pending installs for the Updates view -- allows optional items to be removed from the pending update list --- .../Managed Software Center/MunkiItems.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/code/apps/Managed Software Center/Managed Software Center/MunkiItems.py b/code/apps/Managed Software Center/Managed Software Center/MunkiItems.py index 7535198e..5afa20ab 100644 --- a/code/apps/Managed Software Center/Managed Software Center/MunkiItems.py +++ b/code/apps/Managed Software Center/Managed Software Center/MunkiItems.py @@ -189,9 +189,18 @@ def updatesContainNonUserSelectedItems(): def getEffectiveUpdateList(): '''Combine the updates Munki has found with any optional choices to make the effective list of updates''' - # this was more complex in the past, but caused some edge case issues - # so we're going to simplify - return getUpdateList() + # get pending optional items seperately since OptionalItems have + # extra details/attribbutes + optional_installs = getOptionalWillBeInstalledItems() + optional_removals = getOptionalWillBeRemovedItems() + optional_item_names = [item['name'] + for item in optional_installs + optional_removals] + # filter out pending optional items from the list of all pending updates + # so we can add in the items with additional optional detail + mandatory_updates = [item for item in getUpdateList() + if item['name'] not in optional_item_names] + + return mandatory_updates + optional_installs + optional_removals def getMyItemsList():