本文整理汇总了Python中nova.db.fixed_ip_disassociate_all_by_timeout函数的典型用法代码示例。如果您正苦于以下问题:Python fixed_ip_disassociate_all_by_timeout函数的具体用法?Python fixed_ip_disassociate_all_by_timeout怎么用?Python fixed_ip_disassociate_all_by_timeout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fixed_ip_disassociate_all_by_timeout函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tearDown
def tearDown(self):
"""Runs after each test method to finalize/tear down test
environment."""
try:
self.mox.UnsetStubs()
self.stubs.UnsetAll()
self.stubs.SmartUnsetAll()
self.mox.VerifyAll()
# NOTE(vish): Clean up any ips associated during the test.
ctxt = context.get_admin_context()
db.fixed_ip_disassociate_all_by_timeout(ctxt, FLAGS.host,
self.start)
db.network_disassociate_all(ctxt)
rpc.Consumer.attach_to_eventlet = self.originalAttach
for x in self.injected:
try:
x.stop()
except AssertionError:
pass
if FLAGS.fake_rabbit:
fakerabbit.reset_all()
db.security_group_destroy_all(ctxt)
super(TestCase, self).tearDown()
finally:
self.reset_flags()
示例2: test_fixed_ip_disassociate_all_by_timeout_multi_host
def test_fixed_ip_disassociate_all_by_timeout_multi_host(self):
now = timeutils.utcnow()
ctxt = context.get_admin_context()
self._timeout_test(ctxt, now, True)
result = db.fixed_ip_disassociate_all_by_timeout(ctxt, 'foo', now)
self.assertEqual(result, 1)
result = db.fixed_ip_disassociate_all_by_timeout(ctxt, 'bar', now)
self.assertEqual(result, 0)
示例3: test_fixed_ip_disassociate_all_by_timeout_single_host
def test_fixed_ip_disassociate_all_by_timeout_single_host(self):
now = utils.utcnow()
ctxt = context.get_admin_context()
self._timeout_test(ctxt, now, False)
result = db.fixed_ip_disassociate_all_by_timeout(ctxt, "foo", now)
self.assertEqual(result, 0)
result = db.fixed_ip_disassociate_all_by_timeout(ctxt, "bar", now)
self.assertEqual(result, 1)
示例4: _disassociate_all_by_timeout
def _disassociate_all_by_timeout(cls, context, host, time_str):
time = timeutils.parse_isotime(time_str)
return db.fixed_ip_disassociate_all_by_timeout(context, host, time)