本文整理汇总了Python中quantum.plugins.cisco.db.api.clear_db函数的典型用法代码示例。如果您正苦于以下问题:Python clear_db函数的具体用法?Python clear_db怎么用?Python clear_db使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clear_db函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _test_with_port_creation
def _test_with_port_creation(self, cmd, params=None):
"""Tests commands that requires a port to exist"""
LOG.debug("test_%s - START", cmd)
net = self._l2network.create_network(tenant, net_name)
port = self._l2network.create_port(tenant, net[const.NET_ID],
port_state, state=port_state)
args = [tenant, net[const.NET_ID], port[const.PORT_ID]]
if params is not None:
args.extend(params)
ip_address = getattr(self._ucs_inventory, cmd)(args)
ip_address = ip_address[const.DEVICE_IP][0]
self.assertValidUCM(ip_address)
# Clean up created network and port
try:
self._l2network.unplug_interface(
tenant, net[const.NET_ID], port[const.PORT_ID])
except:
pass
self._l2network.delete_port(tenant,
net[const.NET_ID], port[const.PORT_ID])
self._l2network.delete_network(tenant, net[const.NET_ID])
db.clear_db()
LOG.debug("test_%s - END", cmd)
示例2: test_reserve_segmentation_id_NA
def test_reserve_segmentation_id_NA(self):
LOG.debug("test_reserve_segmentation_id - START")
db.clear_db()
self.assertRaises(c_exc.VlanIDNotAvailable,
self.vlan_mgr.reserve_segmentation_id,
self.tenant_id,
self.net_name)
LOG.debug("test_reserve_segmentation_id - END")
示例3: tearDown
def tearDown(self):
"""Tear down our tests"""
try:
port = db.port_get(self.net_id, self.port_id)
self._l2network_multiblade.delete_port([tenant_id, self.net_id, self.port_id])
except exc.NetworkNotFound:
# We won't always have a port to remove
pass
except exc.PortNotFound:
# We won't always have a port to remove
pass
try:
net = db.network_get(self.net_id)
self._l2network_multiblade.delete_network([tenant_id, self.net_id])
except exc.NetworkNotFound:
# We won't always have a network to remove
pass
db.clear_db()
示例4: tearDown
def tearDown(self):
"""Tear Down"""
db.clear_db()
示例5: tearDown
def tearDown(self):
db.clear_db()