Openstack: How to debug neutron with pdb

When I was much younger and foolish (last month), I tried to debug neutron network creation, by inserting ‘import pdb; pdb.set_trace()’ to  /usr/lib/python2.7/site-packages/neutron/db/ and simply create network, waiting for pdb to take action. But that didn’t happen. I had to guess it will not work since neutron-server starts as a daemon, and not owned by the terminal. So using the pdb.set_trace() had no effect.

The right way would be to start neutron-server directly and not by starting the service. Don’t worry, we’ll do it together. step by step.

Continue reading “Openstack: How to debug neutron with pdb”

Ansible: write and run your first playbook

What is Ansible?

Ansible is a free software for configuring and managing nodes. It easy to use and includes many built-in modules to allow easy configuration management. It uses ssh to connect the different nodes and configure them. The only thing you need on your machine in order to run Ansible is python installed ( > 2.4).

In this post I’m going to show you how to easily write your first playbook and run it. But before that let’s go over some basic definitions:

Continue reading “Ansible: write and run your first playbook”

Jenkins & Gerrit: trigger build on added comment

Sometimes when you submit patch to gerrit, you may have one or several gates running against the patch, verifying it has no issues, so it’s safe to merge it.

But what would you do if want to re-run all gates? usually I see developers using one of the following ways:

  • rebase
  • go to the actual build page in jenkins and click on ‘retrigger all’
  • comment in gerrit system with specific string

Rebase would work only if there is what to rebase on and using directly the build page on jenkins server will only work if you have account with permissions to access this jenkins server – so those two methods would be less convenient to use.

Continue reading “Jenkins & Gerrit: trigger build on added comment”

Python: Lists vs. Tuples

For Python beginners, the differences between lists and tuples might not be as clear as to those who already got some experience using them.


Let’s review the key differences between the two. hopefully, it will help you choose the right type in your code and understand that although this post called ‘lists vs. tuples’ there is no real match here. each type has his own use case.


Mutability talks about the capability of an object to change or alter. This is one of the noticeable difference between the two types.

First, let’s use list:

>>> my_list = [1,2,3]
>>> my_list[2] = 9
>>> print my_list
[1, 2, 9]

Now let’s try the same on tuple:

Continue reading “Python: Lists vs. Tuples”