2
votes

I want to trace the functions used by a particular command, specifically for OpenStack. Now, I have a command, let's say 'nova image-list', which shows the images available in the repository. I want to know what functions is this command calling?

I tried with strace, but the maximum I could get was the files that the command opens (and it's lot of them!). Again I tried with trace module of python, but when I try

tracer.run('nova image-list')

it gives a syntax error. Now, is there tool/mechanism that can help me to get the flow of this command?

1
By functions do you mean the other python methods your code calls or the system calls that are triggered when you run your python code. - sateesh
No, actually I want the methods. Systems calls I can track using strace. - Pensu
You mean a debbuger? Try pdb or ipdb - Paulo Scardine
Ok, I am trying to run in through pdb. I am doing pdb.run('nova image-list'), but I am not able to get globals and locals, what am I supposed to put there? - Pensu

1 Answers

0
votes

most of the python clients for openstack have a not so well documented --debug flag, this will show the api queries occurring in incredibly unsafe verbosity.