Guest User

Untitled

a guest
Sep 23rd, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. @classmethod
  2. def tearDownClass(cls):
  3. for vpnservice in cls.vpnservices:
  4. has_exception = False
  5. try:
  6. cls.client.delete_vpn_service(vpnservice['id'])
  7. except Exception as exc:
  8. LOG.exception(exc)
  9. has_exception = True
  10. if has_exception:
  11. raise TearDownException()
  12.  
  13. for router in cls.routers:
  14. has_exception = False
  15. try:
  16. (cls.client.remove_router_interface_with_subnet_id(
  17. router['id'], cls.subnets[0]['id']))
  18. cls.client.delete_router(router['id'])
  19. except Exception as exc:
  20. LOG.exception(exc)
  21. has_exception = True
  22. if has_exception:
  23. raise TearDownException()
  24.  
  25. for health_monitor in cls.health_monitors:
  26. has_exception = False
  27. try:
  28. cls.client.delete_health_monitor(health_monitor['id'])
  29. except Exception as exc:
  30. LOG.exception(exc)
  31. has_exception = True
  32. if has_exception:
  33. raise TearDownException()
  34. for member in cls.members:
  35. has_exception = False
  36. try:
  37. cls.client.delete_member(member['id'])
  38. except Exception as exc:
  39. LOG.exception(exc)
  40. has_exception = True
  41. if has_exception:
  42. raise TearDownException()
  43. for vip in cls.vips:
  44. has_exception = False
  45. try:
  46. cls.client.delete_vip(vip['id'])
  47. except Exception as exc:
  48. LOG.exception(exc)
  49. has_exception = True
  50. if has_exception:
  51. raise TearDownException()
  52. for pool in cls.pools:
  53. has_exception = False
  54. try:
  55. cls.client.delete_pool(pool['id'])
  56. except Exception as exc:
  57. LOG.exception(exc)
  58. has_exception = True
  59. if has_exception:
  60. raise TearDownException()
  61. for port in cls.ports:
  62. has_exception = False
  63. try:
  64. cls.client.delete_port(port['id'])
  65. except Exception as exc:
  66. LOG.exception(exc)
  67. has_exception = True
  68. if has_exception:
  69. raise TearDownException()
  70. for subnet in cls.subnets:
  71. has_exception = False
  72. try:
  73. cls.client.delete_subnet(subnet['id'])
  74. except Exception as exc:
  75. LOG.exception(exc)
  76. has_exception = True
  77. if has_exception:
  78. raise TearDownException()
  79. for network in cls.networks:
  80. has_exception = False
  81. try:
  82. cls.client.delete_network(network['id'])
  83. except Exception as exc:
  84. LOG.exception(exc)
  85. has_exception = True
  86. if has_exception:
  87. raise TearDownException()
Advertisement
Add Comment
Please, Sign In to add comment