From 69968229c0c572457daf76e88f4e15f9155677f2 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 17 Jan 2012 16:45:24 -0800 Subject: [PATCH] managedsoftwareupdate: warn if DaysBetweenNotifications is not an integer. --- code/client/managedsoftwareupdate | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/client/managedsoftwareupdate b/code/client/managedsoftwareupdate index 8ca973aa..84d7d3f1 100755 --- a/code/client/managedsoftwareupdate +++ b/code/client/managedsoftwareupdate @@ -336,7 +336,15 @@ def notifyUserOfUpdates(force=False): # if we haven't notified in a while, notify: user_was_notified = False lastNotifiedString = munkicommon.pref('LastNotifiedDate') - daysBetweenNotifications = munkicommon.pref('DaysBetweenNotifications') + try: + daysBetweenNotifications = int( + munkicommon.pref('DaysBetweenNotifications')) + except ValueError: + munkicommon.display_warning( + 'DaysBetweenNotifications is not an integer: %s' + % munkicommon.pref('DaysBetweenNotifications')) + # continue with the default DaysBetweenNotifications + daysBetweenNotifications = 1 now = NSDate.new() nextNotifyDate = now if lastNotifiedString: