Browse code

Check for nova-compute before running kill

Unconditionally running this can lead to confusing failure output from
kill as the pgrep matches nothing when nova-compute isn't yet running.

Change-Id: I37cb84fe8e0b393f49b8907af16a3e44f82c46a6

Ian Wienand authored on 2015/07/01 05:18:47
Showing 1 changed files
... ...
@@ -112,6 +112,13 @@ def compute_consoles():
112 112
 
113 113
 def guru_meditation_report():
114 114
     _header("nova-compute Guru Meditation Report")
115
+
116
+    try:
117
+        subprocess.check_call(["pgrep","nova-compute"])
118
+    except subprocess.CalledProcessError:
119
+        print "Skipping as nova-compute does not appear to be running"
120
+        return
121
+
115 122
     _dump_cmd("kill -s USR1 `pgrep nova-compute`")
116 123
     print "guru meditation report in nova-compute log"
117 124