From 3a9df1dab73e2cb2f27dd014543ab16f22ac3846 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 1 Jul 2015 06:18:47 +1000 Subject: [PATCH] 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 --- tools/worlddump.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/worlddump.py b/tools/worlddump.py index 0a9f810877..e4ba02b51c 100755 --- a/tools/worlddump.py +++ b/tools/worlddump.py @@ -112,6 +112,13 @@ def compute_consoles(): def guru_meditation_report(): _header("nova-compute Guru Meditation Report") + + try: + subprocess.check_call(["pgrep","nova-compute"]) + except subprocess.CalledProcessError: + print "Skipping as nova-compute does not appear to be running" + return + _dump_cmd("kill -s USR1 `pgrep nova-compute`") print "guru meditation report in nova-compute log"