lig 发表于 2018-6-2 12:34:02

ipdb 在 openstack 中使用

  1, 安装ipdb
  easy_install ipdb or pip install ipdb

  2,使用ipdb
  net_manager = utils.import_object(FLAGS.network_manager)
  import ipdb;ipdb.set_trace() # 打断点,调试
  
  root@roto-virtual-machine:~/nova/api/openstack/compute/contrib# nova-manage network create private --fixed_range_v4=10.14.23.0/24 --num_networks=1 --network_size=32
  > /usr/bin/nova-manage(795)create()
  794         import ipdb;ipdb.set_trace()
  --> 795         net_manager.create_networks(context.get_admin_context(),
  796                                     label=label,
  

  ipdb> help
  

  Documented commands (type help <topic>):
  ========================================
  EOF    bt         cont      enablejumppdef   r      tbreak   w
  a      c          continueexit    l   pdoc   restartu      whatis
  aliascl         d         h       listpinforeturn   unaliaswhere
  args   clear      debug   help    n   pp   run      unt
  b      commands   disable   ignorenextq      s      until
  breakconditiondown      j       p   quit   step   up
  

  Miscellaneous help topics:
  ==========================
  execpdb
  

  Undocumented commands:
  ======================
  retvalrv
  

  ipdb>
  

  3, nova-network 使用ipdb
  ipdb   /usr/bin/python /usr/bin/nova-network --flagfile=/etc/nova/nova.conf
  
页: [1]
查看完整版本: ipdb 在 openstack 中使用