munkireport / munkireport-php

A reporting tool for munki
MIT License
393 stars 138 forks source link

displays.py Exception handling #117

Closed bochoven closed 10 years ago

bochoven commented 10 years ago

displays.py is not handling exceptions correctly, therefore it is preventing munki from running ok when an exception occurs.

I have a 10.6.8 client that chokes on line 42:

/usr/local/munki/preflight.d/displays.py                                                                                                
Traceback (most recent call last):
  File "/usr/local/munki/preflight.d/displays.py", line 42, in <module>
    elif display['_spdisplays_display-vendor-id'] != "610":
KeyError: '_spdisplays_display-vendor-id'
ghost commented 10 years ago

I haven't noticed. Is this a laptop? Is there any logged in user? any external display?

bochoven commented 10 years ago

Headless Xserve

ghost commented 10 years ago

ok I can reproduce the issue also on an Xserve.

Looks like I missed the scenario when _spdisplays_display-vendor-id does not exist at all. Likely to be broken on macminis too.

let me open a pull for this

bochoven commented 10 years ago

thanks