Skip to content

Instructions to setup Remote Debug with PyCharm

vedlad edited this page Feb 8, 2014 · 1 revision
  1. Make sure you have the exact project codebase in your host computer as you VM
  2. Download PyCharm and add your project by clicking on "Add Directory" or something like it.
  3. At the top right of your IDE's window, Click on the dropdown menu and select "Edit Configurations"
  4. Click on "+" at the top left and select "Python Remote Debug".
  5. Enter a random unused port number in the "Port:" field and Hit OK
  6. Locate the pycharm-debug.egg file on your system (It should have been bundled with your PyCharm) and SCP it to your VM. After that "easy_install" that file on your VM from the VM's shell.
  7. Get back to PyCharm and click on the Green Bug Icon. A Debug tab should pop up from below and display "Waiting for connection..."
  8. On your VM, get to your devstack "screens" by running ./rejoinstack.sh . Then get to your Keystone screen and kill the process by hitting Ctrl+C. After that Hit the Up key and modify the startup command to include --pydev-debug-host [YOUR HOST'S IP] --pydev-debug-port [THE PORT YOU HAD ENTERED IN PYCHARM]

Example: cd /opt/stack/keystone && /opt/stack/keystone/bin/keystone-all --config-file /etc/keystone/keystone.conf --log-config /etc/keystone/logging.conf -d --debug --pydev-debug-host 192.168.56.1 --pydev-debug-port 5678 || echo "key failed to start" | tee "/opt/stack/status/stack/key.failure"

Clone this wiki locally