mirror of
https://github.com/munki/munki.git
synced 2026-05-07 21:09:38 -05:00
Now uses SBApplication.applicationWithURL_ to get the _MunkiStatusApp object if SBApplication.applicationWithBundleIdentifier_ fails, which it might if MunkiStatus has never been launched on that particular machine.
git-svn-id: http://munki.googlecode.com/svn/trunk@496 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
@@ -23,7 +23,7 @@ import subprocess
|
||||
import FoundationPlist
|
||||
import time
|
||||
|
||||
from Foundation import NSDate
|
||||
from Foundation import NSDate, NSURL
|
||||
from ScriptingBridge import SBApplication
|
||||
|
||||
_updatechecklaunchfile = "/private/tmp/.com.googlecode.munki.updatecheck.launchd"
|
||||
@@ -109,6 +109,11 @@ def updateInProgress():
|
||||
_MunkiStatusApp = SBApplication.applicationWithBundleIdentifier_(_MunkiStatusIdentifier)
|
||||
if not _MunkiStatusApp:
|
||||
# LaunchServices can't find MunkiStatus.app
|
||||
# Maybe it's never been launched. Let's look by path
|
||||
fileurl = NSURL.fileURLWithPath_("/Applications/Utilities/Managed Software Update.app/Contents/Resources/MunkiStatus.app")
|
||||
_MunkiStatusApp = SBApplication.applicationWithURL_(fileurl)
|
||||
if not _MunkiStatusApp:
|
||||
# OK, now we're screwed. Can't find MunkiStatus.app at all.
|
||||
return -1
|
||||
# if MunkiStatus is running, we're doing an update right now
|
||||
if _MunkiStatusApp.isRunning():
|
||||
|
||||
Reference in New Issue
Block a user