how to debug tacker

Asked by hwc

Hi Sripriya.

I want to debug tacker, when I debug the tacker with pycharm, I find that the breakpoint which I added is not didn't work, the code wouldn't stop at the breakpoint. I think that I need close the multithreading. But I can't find how to do it, so can you tell me how to debug the tacker .

The following is the breakpoint in server.py. But it doesn't work.
try:
        import pydevd
        pydevd.settrace('192.168.230.1', port=55555, stdoutToServer=True, stderrToServer=True)
        tacker_api = service.serve_wsgi(service.TackerApiService)
        launcher = common_service.launch(tacker_api,
                                         workers=cfg.CONF.api_workers)
        launcher.wait()

Question information

Language:
English Edit question
Status:
Solved
For:
tacker Edit question
Assignee:
Sripriya Edit question
Solved by:
Sripriya
Solved:
Last query:
Last reply:
Revision history for this message
Best Sripriya (sseetha) said :
#1

Hi hwc,
Th easiest way to debug code if you are using PyCharm is to use its inbuilt debug configurations. Refer this blog for the setup:

https://tropicaldevel.wordpress.com/2013/01/24/debugging-openstack-with-pycharm-and-pydevd/

And please follow the PyCharm guidelines itself to add debug points in code:
https://www.jetbrains.com/help/pycharm/2016.1/creating-line-breakpoints.html

Once debug points are added,

Click Run->Edit Configurations, Select Python and then click on '+'

In the script field, give the input as /usr/local/bin/tacker-server
In the Script Parameters field, give the input as --config-file /etc/tacker/tacker.conf

Select 'Run' dropdown button and click 'Debug', this should start the tacker server with debug points enabled. You can now start your code debugging. Let me know if this helped.

Cheers,
Sripriya

Revision history for this message
hwc (1137463337-p) said :
#2

Thanks Sripriya, that solved my question.