Skip to content

Commit ef219bf

Browse files
author
Ihar Hrachyshka
committed
worlddump: request Guru Mediation reports for neutron agents
Those reports may be helpful when debugging neutron gate issues. pgrep is backwards compatible with old Solaris tools, which means it does not match with commands that are longer than 15 characters. To avoid that for neutron agent names which are longer than that, we need to pass -f argument to match against the full cmdline. Also killall instead of kill + pgrep in a subshell. Change-Id: I9b3801e927c0e80443ed76e38cd8e3618e888e49
1 parent 406b45b commit ef219bf

1 file changed

Lines changed: 21 additions & 10 deletions

File tree

tools/worlddump.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727
import sys
2828

2929

30+
GMR_PROCESSES = (
31+
'nova-compute',
32+
'neutron-dhcp-agent',
33+
'neutron-l3-agent',
34+
'neutron-linuxbridge-agent',
35+
'neutron-metadata-agent',
36+
'neutron-openvswitch-agent',
37+
)
38+
39+
3040
def get_options():
3141
parser = argparse.ArgumentParser(
3242
description='Dump world state for debugging')
@@ -191,17 +201,18 @@ def compute_consoles():
191201
_dump_cmd("sudo cat %s" % fullpath)
192202

193203

194-
def guru_meditation_report():
195-
_header("nova-compute Guru Meditation Report")
204+
def guru_meditation_reports():
205+
for service in GMR_PROCESSES:
206+
_header("%s Guru Meditation Report" % service)
196207

197-
try:
198-
subprocess.check_call(["pgrep","nova-compute"])
199-
except subprocess.CalledProcessError:
200-
print("Skipping as nova-compute does not appear to be running")
201-
return
208+
try:
209+
subprocess.check_call(['pgrep', '-f', service])
210+
except subprocess.CalledProcessError:
211+
print("Skipping as %s does not appear to be running" % service)
212+
continue
202213

203-
_dump_cmd("kill -s USR2 `pgrep nova-compute`")
204-
print("guru meditation report in nova-compute log")
214+
_dump_cmd("killall -e -USR2 %s" % service)
215+
print("guru meditation report in %s log" % service)
205216

206217

207218
def main():
@@ -218,7 +229,7 @@ def main():
218229
iptables_dump()
219230
ebtables_dump()
220231
compute_consoles()
221-
guru_meditation_report()
232+
guru_meditation_reports()
222233

223234

224235
if __name__ == '__main__':

0 commit comments

Comments
 (0)