本文整理汇总了Python中nova.availability_zones.reset_cache函数的典型用法代码示例。如果您正苦于以下问题:Python reset_cache函数的具体用法?Python reset_cache怎么用?Python reset_cache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了reset_cache函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
super(AvailabilityZoneApiTest, self).setUp()
availability_zones.reset_cache()
self.stubs.Set(db, 'service_get_all', fake_service_get_all)
self.stubs.Set(availability_zones, 'set_availability_zones',
fake_set_availability_zones)
self.stubs.Set(servicegroup.API, 'service_is_up', fake_service_is_up)
示例2: setUp
def setUp(self):
super(ExtendedServerAttributesTest, self).setUp()
availability_zones.reset_cache()
fakes.stub_out_nw_api(self.stubs)
self.stubs.Set(compute.api.API, 'get', fake_compute_get)
self.stubs.Set(compute.api.API, 'get_all', fake_compute_get_all)
self.stubs.Set(availability_zones, 'get_host_availability_zone',
fake_get_host_availability_zone)
示例3: setUp
def setUp(self):
super(AvailabilityZoneApiTestV21, self).setUp()
availability_zones.reset_cache()
self.stubs.Set(db, 'service_get_all', fake_service_get_all)
self.stubs.Set(availability_zones, 'set_availability_zones',
fake_set_availability_zones)
self.stubs.Set(servicegroup.API, 'service_is_up', fake_service_is_up)
self.controller = self.availability_zone.AvailabilityZoneController()
self.req = fakes.HTTPRequest.blank('')
示例4: setUp
def setUp(self):
super(ExtendedServerAttributesTest, self).setUp()
availability_zones.reset_cache()
fakes.stub_out_nw_api(self.stubs)
self.stubs.Set(compute.api.API, "get", fake_compute_get)
self.stubs.Set(compute.api.API, "get_all", fake_compute_get_all)
self.stubs.Set(availability_zones, "get_host_availability_zone", fake_get_host_availability_zone)
return_server = fakes.fake_instance_get()
self.stubs.Set(db, "instance_get_by_uuid", return_server)
示例5: setUp
def setUp(self):
super(ExtendedAvailabilityZoneTestV21, self).setUp()
availability_zones.reset_cache()
fakes.stub_out_nw_api(self.stubs)
self.stubs.Set(compute.api.API, 'get', fake_compute_get)
self.stubs.Set(compute.api.API, 'get_all', fake_compute_get_all)
self.stubs.Set(availability_zones, 'get_host_availability_zone',
fake_get_host_availability_zone)
return_server = fakes.fake_instance_get()
self.stubs.Set(db, 'instance_get_by_uuid', return_server)
示例6: setUp
def setUp(self):
super(AvailabilityZoneApiTestV21, self).setUp()
availability_zones.reset_cache()
self.stubs.Set(db, 'service_get_all', fake_service_get_all)
self.stubs.Set(availability_zones, 'set_availability_zones',
fake_set_availability_zones)
self.stubs.Set(servicegroup.API, 'service_is_up', fake_service_is_up)
self.controller = self.availability_zone.AvailabilityZoneController()
self.admin_webreq = webob.Request.blank('')
self.admin_webreq.environ['nova.context'] = context.get_admin_context()
示例7: setUp
def setUp(self):
super(AvailabilityZoneApiTestV21, self).setUp()
availability_zones.reset_cache()
fakes.stub_out_nw_api(self)
self.stub_out('nova.db.api.service_get_all', fake_service_get_all)
self.stub_out('nova.availability_zones.set_availability_zones',
lambda c, services: services)
self.stub_out('nova.servicegroup.API.service_is_up',
lambda s, service: service['binary'] != u"nova-network")
self.controller = self.availability_zone.AvailabilityZoneController()
self.req = fakes.HTTPRequest.blank('')
示例8: setUp
def setUp(self):
super(ExtendedAvailabilityZoneTestV21, self).setUp()
availability_zones.reset_cache()
fakes.stub_out_nw_api(self)
fakes.stub_out_secgroup_api(self)
self.stub_out('nova.compute.api.API.get', fake_compute_get)
self.stub_out('nova.compute.api.API.get_all', fake_compute_get_all)
self.stub_out('nova.availability_zones.get_host_availability_zone',
fake_get_host_availability_zone)
return_server = fakes.fake_instance_get()
self.stub_out('nova.db.instance_get_by_uuid', return_server)
示例9: setUp
def setUp(self):
super(ExtendedServerAttributesTest, self).setUp()
availability_zones.reset_cache()
fakes.stub_out_nw_api(self.stubs)
self.stubs.Set(compute.api.API, 'get', fake_compute_get)
self.stubs.Set(compute.api.API, 'get_all', fake_compute_get_all)
self.stubs.Set(availability_zones, 'get_host_availability_zone',
fake_get_host_availability_zone)
self.flags(
osapi_compute_extension=[
'nova.api.openstack.compute.contrib.select_extensions'],
osapi_compute_ext_list=['Extended_availability_zone'])
示例10: setUp
def setUp(self):
super(AvailabilityZoneApiTestV21, self).setUp()
availability_zones.reset_cache()
fakes.stub_out_nw_api(self)
self.stub_out('nova.availability_zones.set_availability_zones',
lambda c, services: services)
self.stub_out('nova.servicegroup.API.service_is_up',
lambda s, service: service['binary'] != u"nova-network")
self.controller = self.availability_zone.AvailabilityZoneController()
self.mock_service_get_all = mock.patch.object(
self.controller.host_api, 'service_get_all',
side_effect=fake_service_get_all).start()
self.addCleanup(self.mock_service_get_all.stop)
self.req = fakes.HTTPRequest.blank('')
示例11: setUp
def setUp(self):
super(ExtendedAvailabilityZoneTest, self).setUp()
availability_zones.reset_cache()
fakes.stub_out_nw_api(self.stubs)
self.stubs.Set(compute.api.API, 'get', fake_compute_get)
self.stubs.Set(compute.api.API, 'get_all', fake_compute_get_all)
self.stubs.Set(availability_zones, 'get_host_availability_zone',
fake_get_host_availability_zone)
return_server = fakes.fake_instance_get()
self.stubs.Set(db, 'instance_get_by_uuid', return_server)
self.flags(
osapi_compute_extension=[
'nova.api.openstack.compute.contrib.select_extensions'],
osapi_compute_ext_list=['Extended_availability_zone'])
示例12: test_rest_availability_zone_reset_cache
def test_rest_availability_zone_reset_cache(self):
az._get_cache().add('cache', 'fake_value')
az.reset_cache()
self.assertIsNone(az._get_cache().get('cache'))
示例13: test_rest_availability_zone_reset_cache
def test_rest_availability_zone_reset_cache(self):
az.reset_cache()
self.assertEqual(az._get_cache().get("cache"), None)