Skip to content

Instantly share code, notes, and snippets.

@niedbalski
Last active August 29, 2015 14:06
Show Gist options
  • Save niedbalski/874633ce26eb0e0599cb to your computer and use it in GitHub Desktop.
Save niedbalski/874633ce26eb0e0599cb to your computer and use it in GitHub Desktop.
Using rpdb charmhelpers

Usage

On your charms code, put a trace exception

from charmhelpers.contrib.python import pdb

@hooks.hook()
def install():
   pdb.set_trace()
   ...

Then install the python juju plugins on your local machine

$ git clone https://github.com/juju/plugins.git ~/.juju-plugins
$ echo 'PATH=$PATH:$HOME/.juju-plugins' >> ~/.bash_profile
$ source ~/.bash_profile

Then deploy your charm

$ juju deploy charm

Once your pdb trace is raised, connect to your unit:

$ juju pdb --unit charm/0

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment