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 ...
随机推荐
- Android 在代码中安装 APK 文件
废话不说,上代码 private void install(String filePath) { Log.i(TAG, "开始执行安装: " + filePath); File a ...
- 实现上下全屏幕屏滚动效果js
---恢复内容开始--- 详情见代码 第一步:首先添加3个js文件: 1.http://cdn.staticfile.org/jquery/1.8.3/jquery.min.js 2.http://c ...
- SQL Server中行列转置方法
PIVOT用于将列值旋转为列名(即行转列),在SQL Server 2000可以用聚合函数配合CASE语句实现 PIVOT的一般语法是:PIVOT(聚合函数(列) FOR 列 in (…) )AS P ...
- CAD参数绘制角度标注(com接口)
主要用到函数说明: _DMxDrawX::DrawDimAngular 绘制一个角度标注.详细说明如下: 参数 说明 DOUBLE dAngleVertexX 角度标注的顶点的X值 DOUBLE dA ...
- zabbix4.2学习笔记--新建用户组和用户
新建用户组 zabbix中管理机器是以用户组划分,这里新建一个只读用户群组和只读用户 新建用户组 点击 管理-用户组-创建用户群组,如下图 点击创建之后,有三列设置,分别是用户群组.权限和标签过滤器, ...
- POJ 1637 Sightseeing tour 建图+网络流
题意: 给定一个混合图,所谓混合图就是图中既有单向边也有双向边,现在求这样的图是否存在欧拉回路. 分析: 存在欧拉回路的有向图,必须满足[入度==出度],现在,有些边已经被定向,所以我们直接记录度数即 ...
- Linux 内核框架图
- 小甲鱼python疑难点
1.python生成器 2.while 1: num = input('请输入一个整数(输入Q结束程序):') if num != 'Q': num = int(num) print('十进制 -&g ...
- Error opening session. Cause: java.lang.NullPointerExcept.
在学mybatis时遇到这个问题,后面发现时打错了一个字母,发现后分享出来,如果发现这个错误也能够更好的排除错误. 如图可以发现我不小心把default打成了defaule所以出现了这个错误,也找了好 ...
- Java 文件操作大集合
package com.sess.hny.sys.fileserver; import java.io.BufferedInputStream;import java.io.BufferedOutpu ...