<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<font style="font-size:10pt;" color="#366092" face="Tahoma" size="2">Thank you both. I have used pdb today with quantum service, just as you explained: by placing pdb.set_trace() function where I wanted to run the code myself. All worked well except when the a wait function from the eventlet library was called. After which program waits for an input and when an event happens it just doesn't return back to pdb (and continues normally). <br><br>And yes, it seems that GUI tool might be hard to use, since there is no single main function but many daemons working together so it makes sense to go through each daemon at a time using pdb. But may be I am wrong...<br>Hope other people also share their experience.<br><br>Thanks again,<br>Salman<br id="FontBreak"></font><br><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">From: Mandar.Vaze@nttdata.com<br>To: salmanmk@live.com; openstack@lists.launchpad.net<br>Subject: RE: [Openstack] Development/Debugging<br>Date: Tue, 12 Jun 2012 03:58:39 +0000<br><br>



<style><!--
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman","serif";}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman","serif";}
.ExternalClass p.ecxMsoListParagraph, .ExternalClass li.ecxMsoListParagraph, .ExternalClass div.ecxMsoListParagraph
{margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman","serif";}
.ExternalClass span.ecxEmailStyle18
{font-family:"Calibri","sans-serif";color:#1F497D;}
.ExternalClass .ecxMsoChpDefault
{font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;}
.ExternalClass div.ecxWordSection1
{page:WordSection1;}
.ExternalClass ol
{margin-bottom:0in;}
.ExternalClass ul
{margin-bottom:0in;}

--></style>


<div class="ecxWordSection1">
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Salman,</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I haven’t used UI tools like Pydev and/or eclipse. I have a devstack installation running on linux box where I use ssh for all my development.</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">TL;DR Version : I use pdb (aka Python Debugger) It is very easy to use if you have used gdb - (Refer to 
</span><a href="http://docs.python.org/library/pdb.html#debugger-commands" target="_blank">http://docs.python.org/library/pdb.html#debugger-commands</a>
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">if you are unfamiliar with pdb)</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Longer Version:</span></p>
<p class="ecxMsoListParagraph" style="text-indent:-.25in"><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D"><span style="">·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">To trace how the “allocate_for_instance” works for Quantum –  put “pdb.set_trace()” in method “def allocate_for_instance” in file nova/network/quantum/manager.py</span></p>
<p class="ecxMsoListParagraph"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">You also need “import pdb” somewhere at the top in the same file.</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoListParagraph" style="text-indent:-.25in"><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D"><span style="">·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Stop and restart nova-network process from “screen” (So that modified nova/network/quantum/manager.py is used.)</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoListParagraph" style="text-indent:-.25in"><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D"><span style="">·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Try to create an instance (which eventually needs to allocate fixed IP for the instance) Now go to “nova-network” console – as soon as RPC call is
 made to the method “allocate_for_instance” , execution will stop and you are presented with (pdb) interactive prompt – From here on you can debug using pdb commands
</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-Mandar</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="ecxMsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> openstack-bounces+mandar.vaze=nttdata.com@lists.launchpad.net [mailto:openstack-bounces+mandar.vaze=nttdata.com@lists.launchpad.net]
<b>On Behalf Of </b>Salman Malik<br>
<b>Sent:</b> Monday, June 11, 2012 10:49 PM<br>
<b>To:</b> openstack@lists.launchpad.net<br>
<b>Subject:</b> [Openstack] Development/Debugging</span></p>
</div>
</div>
<p class="ecxMsoNormal"> </p>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#366092">Hi All,<br>
<br>
I have been trying to get my head around the OpenStack functionality for a while now but unfortunately haven't been able to grasp it. I am interested on working on Quantum (and may be creating new plugins) but I am still unable to debug my own problems. So
 I thought it would be best for me to learn from how code works. Although I have been looking at the code for quite some time but didn't get anywhere. Now I have installed Pydev on Eclipse and am wondering how to run the massive OpenStack code in debug mode
 (so as to learn the call/control flow) ? So I thought I could get some help from OpenStack gurus like how do you people develop/debug problems ? What environment are you using ? Any suggestions/tips are welcome.
<br>
(Please note that I have read the nova and Quantum administration guides and also looked at the nova developer's guide)<br>
<br>
Any help would be much appreciated.<br>
<br>
Thanks,<br>
Salman</span><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""></span></p>
</div>
</div>
<br clear="all">
______________________________________________________________________<br>
Disclaimer:This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data.  If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding<br></div>                                          </div></body>
</html>