anilkumar61 / munki

Automatically exported from code.google.com/p/munki
Other
0 stars 0 forks source link

Munki2: MSC launch exception when InstallInfo file missing #302

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Upon trying to reproduce another issue, I decided to wipe the slate and 
completely remove /Library/Managed Installs.

What steps will reproduce the problem?
1. rm -rf "/Library/Managed Installs"
2. launch MSC via the CLI
3. exception below:

What is the expected output? What do you see instead?

/Applications/Managed\ Software\ Center.app/Contents/MacOS/Managed\ Software\ 
Center 
2014-03-26 12:50:17.560 Managed Software Center[5537:507] MSC GUI version: 
4.0.1960
2014-03-26 12:50:17.563 Managed Software Center[5537:507] PyObjC: Converting 
exception to Objective-C:
Traceback (most recent call last):
  File "/Applications/Managed Software Center.app/Contents/Resources/MSUAppDelegate.py", line 77, in applicationDidFinishLaunching_
    self.mainWindowController.loadInitialView()
  File "/Applications/Managed Software Center.app/Contents/Resources/MSUMainWindowController.py", line 147, in loadInitialView
    if MunkiItems.getEffectiveUpdateList():
  File "/Applications/Managed Software Center.app/Contents/Resources/MunkiItems.py", line 158, in getEffectiveUpdateList
    optional_item_names = [item['name'] for item in getInstallInfo().get('optional_installs')]
TypeError: 'NoneType' object is not iterable
2014-03-26 12:50:17.565 Managed Software Center[5537:507] <type 
'exceptions.TypeError'>: 'NoneType' object is not iterable

What version of the Munki tools/InstallOSpkg tools are you using? On what
version of OS X?

MSC 4.0.1960, OS X 10.9.2

Please provide any additional information below.

Original issue reported on code.google.com by t...@synthist.net on 26 Mar 2014 at 7:54

GoogleCodeExporter commented 9 years ago
I worked around this by falling back to an empty list for 
getInstallInfo().get():

diff --git a/code/Managed Software Center/Managed Software Center/MunkiItems.py 
b/code/Managed Software Center/Managed Software Center/MunkiItems.py
index 629c20e..99bb0e1 100644
--- a/code/Managed Software Center/Managed Software Center/MunkiItems.py    
+++ b/code/Managed Software Center/Managed Software Center/MunkiItems.py    
@@ -155,7 +155,7 @@ def getEffectiveUpdateList():
     '''Combine the updates Munki has found with any optional choices to
         make the effective list of updates'''
     managed_update_names = getInstallInfo().get('managed_updates', [])
-    optional_item_names = [item['name'] for item in 
getInstallInfo().get('optional_installs')]
+    optional_item_names = [item['name'] for item in 
getInstallInfo().get('optional_installs', [])]
     self_service_installs = SelfService().installs()
     self_service_uninstalls = SelfService().uninstalls()
     # items in the update_list that are part of optional_items

Original comment by t...@synthist.net on 26 Mar 2014 at 7:57

GoogleCodeExporter commented 9 years ago
This issue was closed by revision bc573124d2c6.

Original comment by gregnea...@mac.com on 26 Mar 2014 at 8:34