Created
June 5, 2013 12:52
-
-
Save timsutton/5713636 to your computer and use it in GitHub Desktop.
Small fix to possibly handle broken system_profiler by dying immediately, instead of only timing out.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/code/client/munkilib/munkicommon.py b/usr/local/munki/munkilib/munkicommon.py | |
index 428bc14..999947d 100755 | |
--- a/code/client/munkilib/munkicommon.py | |
+++ b/usr/local/munki/munkilib/munkicommon.py | |
@@ -2032,7 +2032,11 @@ def getSPApplicationData(): | |
stdin=subprocess.PIPE, stdout=subprocess.PIPE, | |
stderr=subprocess.PIPE) | |
try: | |
- output, unused_error = proc.communicate(timeout=60) | |
+ output, err = proc.communicate(timeout=60) | |
+ if err: | |
+ display_error("error from system_profiler:") | |
+ display_error(err) | |
+ return SP_APPCACHE | |
except TimeoutError: | |
display_error( | |
'system_profiler hung; skipping SPApplicationsDataType query') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment