Debugging python-novaclient on the command line.

I have done lately quite a bit of work with python-novaclient the (nova/keystone) openstack client. I often experiment it with ipython in the console.

There is a nice debugging facility in novaclient which you can see while using –debug argument on the command line and if you wanted to use it with ipython you could have that at the beginning of your session :

This would give you the details of the session showing you the REST requests and responses including the headers. It even show you the curl commands that you can use on the command line to experiment with it.

One thought on “Debugging python-novaclient on the command line.”

  1. Thanks for this information. I tried it and I am getting this error:

    Traceback (most recent call last):
    File “list.py”, line 14, in
    novaclient.client._logger.setLevel(logging.DEBUG)
    AttributeError: ‘module’ object has no attribute ‘_logger’

    My code:

    from novaclient.v1_1 import client as nclient
    import logging
    import novaclient

    ch = logging.StreamHandler()
    novaclient.client._logger.setLevel(logging.DEBUG)
    novaclient.client._logger.addHandler(ch)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.