eclipse+pydev調試openstack

來源:互聯網
上載者:User

eclipse+pydev調試openstack

1.為了調試openstack,另外安裝一個eclipse。

2.在eclipse上安裝pydev外掛程式:

window->preferences->general->networkconnect

activeprovider:manual

editproxy entry:schema:http,host:127.0.0.1,port:8123,

help->installnew software->work with:pydev - http://pydev.org/updates

選擇跟系統中python版本相對應的pydev版本

取消“show only the latestversions of available software”

next->finish

3.(將虛擬機器裡搭建好的openstack源碼拷貝到本地eclipse的workspace工程中“my_openstack”)

file->new->pydevproject->project name :my_openstack

取消“use default”

選擇目錄“/root/workspace/my_openstack”

grammarversion:對應python版本

iterpreter:python

"addproject directory to the PYTHONPATH"

finish

4.拷貝eclipse\plugins\org.python.pydev_x.x.x\pysrc目錄到虛擬機器中“/home/pysrc”

5.修改虛擬機器的pysrc中pydev_file_utils.py:

PATHS_FROM_ECLIPSE_TO_PYTHON=[(r'/root/soft/eclipse_jck/plugins/org.python.pydev_2.6.0.2012062818/pysrc/',r'/home/panfy/pysrc/'),(r'/root/workspace/pydev_openstack/',r'/usr/lib/python2.7/site-packages/')]

DEBUG_CLIENT_SERVER_TRANSLATION= True

6.修改虛擬機器的openstack代碼:

例:要調試ceilometerclient.

修改ceilometerclient中的shell.py

importsys

sys.path.append('/home/pysrc')

添加import pydevd;pydevd.settrace('10.167.225.103')IP地址是本地主機的地址

到要調試處的開頭

7.在eclipse中:

*debug->啟動調試服務:pydev:start the pydevserver

有“debug server at port:5678”提示

8.在虛擬機器中執行相應的命令,觸發調試

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.