Make some global consts for ManagedInstalls(.plist) paths. Replace single-quoted docstrings with double-quotes to standardize across codebase.

git-svn-id: http://munki.googlecode.com/svn/trunk@743 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Justin McWilliams
2010-09-10 01:05:37 +00:00
parent 5873a12d26
commit eeb5bdcb9d
2 changed files with 38 additions and 34 deletions
+5 -5
View File
@@ -73,11 +73,11 @@ def clearLastNotifiedDate():
"""Clear the last date the user was notified of updates."""
try:
plist = FoundationPlist.readPlist(
"/Library/Preferences/ManagedInstalls.plist")
munkicommon.MANAGED_INSTALLS_PLIST_PATH)
if plist:
if 'LastNotifiedDate' in plist:
cmd = ['/usr/bin/defaults', 'delete',
'/Library/Preferences/ManagedInstalls',
munkicommon.MANAGED_INSTALLS_PLIST_PATH_NO_EXT,
'LastNotifiedDate']
unused_retcode = subprocess.call(cmd)
except FoundationPlist.NSPropertyListSerializationException:
@@ -223,11 +223,11 @@ def recordUpdateCheckResult(result):
"""Record last check date and result"""
now = NSDate.new()
cmd = ['/usr/bin/defaults', 'write',
'/Library/Preferences/ManagedInstalls',
munkicommon.MANAGED_INSTALLS_PLIST_PATH_NO_EXT,
'LastCheckDate', '-date', str(now)]
unused_retcode = subprocess.call(cmd)
cmd = ['/usr/bin/defaults', 'write',
'/Library/Preferences/ManagedInstalls',
munkicommon.MANAGED_INSTALLS_PLIST_PATH_NO_EXT,
'LastCheckResult', '-int', str(result)]
unused_retcode = subprocess.call(cmd)
@@ -253,7 +253,7 @@ def notifyUserOfUpdates():
if now.timeIntervalSinceDate_(nextNotifyDate) > 0:
# record current notification date
cmd = ['/usr/bin/defaults', 'write',
'/Library/Preferences/ManagedInstalls',
munkicommon.MANAGED_INSTALLS_PLIST_PATH_NO_EXT,
'LastNotifiedDate', '-date', str(now)]
unused_retcode = subprocess.call(cmd)