mirror of
https://github.com/munki/munki.git
synced 2026-01-25 00:19:39 -06:00
Don't ignore exceptions thrown in app_usage_monitor if given a bad request (one containing a None/nil value)
This commit is contained in:
@@ -48,7 +48,7 @@ except ImportError:
|
||||
sys.exit(-1)
|
||||
|
||||
# our libs
|
||||
from munkilib.wrappers import writePlistToString
|
||||
from munkilib.wrappers import writePlistToString, PlistWriteError
|
||||
|
||||
|
||||
APPUSAGED_SOCKET = "/var/run/appusaged"
|
||||
@@ -74,7 +74,11 @@ class AppUsageClient(object):
|
||||
|
||||
def send_request(self, request):
|
||||
'''Send a request to appusaged'''
|
||||
self.socket.send(writePlistToString(request))
|
||||
try:
|
||||
request_string = writePlistToString(request)
|
||||
self.socket.send(request_string)
|
||||
except PlistWriteError as err:
|
||||
return "ERROR:Bad request: %s" % err
|
||||
# use select so we don't hang indefinitely if appusaged dies
|
||||
ready = select.select([self.socket.fileno()], [], [], 2)
|
||||
if ready[0]:
|
||||
|
||||
Reference in New Issue
Block a user