How to remote debug neutron
First of all, I will assume that you know how to use pydevd to remote debug normal python program. If you do not know that, you can read the corresponding docs on Pycharm official website.
If you know very well how to remote debug normal python programs and you are trying to remote debug neutron, you can continue.
To remote debug neutron, only three additional things need to be done:
1. Change the worker numbers of neutron api server.
You need to edit /etc/neutron/neutron.conf to set api_worker = -1. Because by default, neutron will start multi-workers.
2. Config your IDE (my case it is PyCharm).
In Pycharm you need to set
File->Build, Extension, Debugger->Python Debuger->Gevent Compatible
3. In neutron code, You need to edit neutron/common/eventlet_utils.py
On the server, the absolute path will be the neutron install location. Like /usr/lib/python2.7/site-packages/neutron/common/eventlet_utils.py
Change the
eventlet.monkey_patch
to
eventlet.monkey_patch(os=False, thread=False)
The reason to do this is very well explained in the code comment
import os
import eventlet
def monkey_patch():
	if os.name == 'nt':
		# eventlet monkey patching the os and thread modules causes
		# subprocess.Popen to fail on Windows when using pipes due
		# to missing non-blocking IO support.
		#
		# bug report on eventlet:
		# https://bitbucket.org/eventlet/eventlet/issue/132/
		#       eventletmonkey_patch-breaks
		eventlet.monkey_patch(os=False, thread=False)
	else:
		eventlet.monkey_patch(os=False, thread=False)
OK now. You can remote debug as you did.
How to remote debug neutron的更多相关文章
- iOS web remote debug 正确的姿势
		
在使用iOS Remote debug需要做以下准备 1. iOS devices 开启java script and web inspector 开启方式如下: 2. mac OS 自带的Safar ...
 - Java:Remote Debug
		
Java Remote Debug -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,add ...
 - [Reomting Debug] 巧用VS 的remote debug 功能远程调试程序 经验分享.
		
前言: 有时候我们Dev(开发人员)需要debug tester(测试人员)或者customer(客户)的环境,可tester的机器上没有Code,是不是有点着急? 而且是多版本应用且tester 发 ...
 - paip. java resin 远程 调试 java resin remote debug
		
paip. java resin 远程 调试 java resin remote debug 作者Attilax 艾龙, EMAIL:1466519819@qq.com 来源:attilax的专栏 ...
 - How to use VS2012 remote debug Windows Azure Cloud Services
		
Background: Windows Azure Cloud Services 可以在本地调试,使用Visual Studio 2012 + 模拟器 Emulator.但是模拟器的工作状态和环境和真 ...
 - VS 开发工具中的Remote Debug 功能远程调试程序经验分享
		
前言: 有时候我们Dev(开发人员)需要debug tester(测试人员)或者customer(客户)的环境,可tester的机器上没有Code,是不是有点着急? 而且是多版本应用且tester 发 ...
 - Tomcat Remote Debug操作和原理
		
操作篇 这部分主要讲,如何开启tomcat远程调试,并佐以实例.本文方式适用于windows和linux. 假设有两台机器,A是tomcat服务器所在机器,B是IDE安装机器.A和B可以是同一台机器, ...
 - vscode local attach 和 remote debug
		
VSCode是MS推出的一款免费的开源并跨平台的轻量级代码编辑器,内置Git和Debug等常用功能,强大的插件扩展功能以及简单的配置几乎可以打造成任意编程语言的IDE.本文简单聊一下其本地attach ...
 - QT Creator 环境使用 remote debug 调试 arm 程序
		
这里使用的 4.8.5 QTE 环境,之前尝试过远程使用 GDB 来调试板子上的 QT 程序,但是没成功.没有调试手段比较痛苦,今天又花了点时间,居然搞定了.粗做记录. 工具版本: 1. QtCrea ...
 
随机推荐
- Ubuntu Linux14 64位下在Android studio下用gradle编译Andrid项目时发生libz.so.1共享库找不到的解决方法。
			
---恢复内容开始--- 我在Ubuntu14 64为下安装了AS,但在用Gradle编译项目时总是报找不到 libz.so.1的错误. error while loading shared libr ...
 - <jsp:include page="${pageContext.request.contextPath/index.jsp" ></jsp:include> 引发的错误
			
路径引发的错误 如下使用项目路径对jsp页面进行获取,会报javax.servlet.ServletException: File "/web/dbwx/web/public/page_to ...
 - CHECKPOINT - 强制一个事务日志检查点
			
SYNOPSIS CHECKPOINT DESCRIPTION 描述 预写式日志(Write-Ahead Logging (WAL))缺省时在事务日志中每隔一段时间放一个检查点. (要调整这个原子化的 ...
 - C#筆記--DataGridView使用
			
1.databingcomplete 当数据源的内容更改时,或者当 DataSource.DataMember 或 BindingContext 属性的值更改时,会引发此事件. 例如,如果要基于内容更 ...
 - Perl字符集[\d\D]表示任何字符(所有数字和非数字,包括换行符),“.”表示除了换行符以外的所有字符。
			
Perl字符集[\d\D]表示任何字符(所有数字和非数字,包括换行符),“.”表示除了换行符以外的所有字符.
 - Delphi 正则表达式  TPerlRegEx 类
			
抄自:万一的博客 http://www.cnblogs.com/del/category/113551.html 目录: 基本方法 查找(目标字符串及其属性) 字表达式 限定匹配范围:start.st ...
 - js 技巧 (七)JS代码判断集锦(之一)
			
JS代码判断集锦(之一) ~~~~~~~~~~~~~~~~~~ <script language="JavaScript"> function checkid(iden ...
 - NodeJs中数据库的使用
			
另一遍通用的NODEJS数据库方法koa,express,node 通用方法连接MySQL 1.Node.js 连接 MySQL $ cnpm install mysql 连接mysql: var m ...
 - 第二十二节:scrapy爬虫识别验证码(一)类库安装
			
一.安装tesserocr 1.首先下载tesseract:https://digi.bib.uni-mannheim.de/tesseract/ ,我下载的是tesseract-ocr-setup- ...
 - 【ZOJ - 3780】  Paint the Grid Again (拓扑排序)
			
Leo has a grid with N × N cells. He wants to paint each cell with a specific color (either black or ...