<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">I think we need to pick either one or the other. We currently have two places where debugging is documented, the OpenStack wiki and in the Neutron tree<br>
<br>
http://git.openstack.org/cgit/openstack/neutron/tree/TESTING.rst#n143<br>
<br>
<div>
<div style="font-family:Tahoma; font-size:13px">Sean M. Collins<br>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF844180"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Gal Sagie [gsagie@vmware.com]<br>
<b>Sent:</b> Wednesday, June 11, 2014 8:36 AM<br>
<b>To:</b> gessau@cisco.com<br>
<b>Cc:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Subject:</b> Re: [openstack-dev] [Neutron] Debugging Devstack Neutron with Pycharm<br>
</font><br>
</div>
<div></div>
<div>
<div style="font-family:times new roman,new york,times,serif; font-size:12pt; color:#000000">
<div>Thanks a lot, this works, i will update the wiki.</div>
<div><br>
</div>
<div>Gal.</div>
<hr id="zwchr">
<div style="color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<b>From: </b>"Henry Gessau" <gessau@cisco.com><br>
<b>To: </b>openstack-dev@lists.openstack.org<br>
<b>Sent: </b>Wednesday, June 11, 2014 2:41:47 PM<br>
<b>Subject: </b>Re: [openstack-dev] [Neutron] Debugging Devstack Neutron with        Pycharm<br>
<div><br>
</div>
<div class="moz-cite-prefix">Gal Sagie wrote:<br>
</div>
<blockquote>
<div style="font-family:times new roman,new york,times,serif; font-size:12pt; color:#000000">
I am trying to debug devstack Neutron with Pycharm, i have found here (<a href="https://wiki.openstack.org/wiki/NeutronDevelopment#How_to_debug_Neutron_.28and_other_OpenStack_projects_probably_.29" target="_blank">https://wiki.openstack.org/wiki/NeutronDevelopment#How_to_debug_Neutron_.28and_other_OpenStack_projects_probably_.29</a>)
<div style="color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<div style="font-family:times new roman,new york,times,serif; font-size:12pt; color:#000000">
<div>That i need to change the neutron server code to this=><b style="">eventlet.monkey_patch()</b><span style="color:#333333; font-family:'Arial Unicode MS',Arial,sans-serif; font-size:14px; line-height:20px; background-color:#ffffff"> To: </span><b style="color:#333333; font-family:'Arial Unicode MS',Arial,sans-serif; font-size:14px; line-height:20px; background-color:#ffffff">eventlet.monkey_patch(os=False,
 thread=False)</b></div>
</div>
</div>
</div>
</blockquote>
I don't need to do this. But I do need to go into the PyCharm settings under Python Debugger and enable "Gevent compatible debugging".<br>
<blockquote>
<div style="font-family:times new roman,new york,times,serif; font-size:12pt; color:#000000">
<div style="color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<div style="font-family:times new roman,new york,times,serif; font-size:12pt; color:#000000">
<div><br>
</div>
<div>I have done so, debug seems to run, but when i am trying to initiate commands from the CLI i get this:</div>
<div>
<p>gal@ubuntu:~/devstack$ neutron net-list<br>
Connection to neutron failed: Maximum attempts reached</p>
</div>
</div>
</div>
</div>
</blockquote>
Are you sure you have sourced openrc correctly for the credentials?<br>
<blockquote>
<div style="font-family:times new roman,new york,times,serif; font-size:12pt; color:#000000">
<div style="color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<div style="font-family:times new roman,new york,times,serif; font-size:12pt; color:#000000">
<div>
<p>(the server seems to run ok...)</p>
<p><span style="font-size:12pt">Any help is appreciated as i am trying to learn and understand main flows by debugging the code locally.</span></p>
<br>
</div>
</div>
</div>
</div>
</blockquote>
First I start devstack in offline mode.<br>
    OFFLINE=True ./stack.sh<br>
<br>
Once it is running I go to the neutron window in screen.<br>
There I stop neutron-server with ctrl-C, and press up-arrow to view the start command.<br>
<br>
To run neutron-server in the PyCharm debugger edit the Run/Debug configuration with the following settings:<br>
<br>
Script: /usr/local/bin/neutron-server<br>
Script params: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini<br>
    # I got this from the screen window where I stopped neutron<br>
Working directory: /opt/stack/neutron<br>
<br>
Now restart neutron from PyCharm instead of screen.<br>
<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
OpenStack-dev@lists.openstack.org<br>
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev<br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>