示例#1
0
 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)
 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)
示例#3
0
 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)
 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
0
 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('')
示例#6
0
 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('')
示例#7
0
 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)
示例#8
0
 def setUp(self):
     super(ExtendedAvailabilityZoneTestV21, self).setUp()
     availability_zones.reset_cache()
     fakes.stub_out_nw_api(self)
     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.stub_out('nova.db.instance_get_by_uuid', return_server)
 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)
示例#10
0
 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()
示例#11
0
 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()
示例#12
0
 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('')
示例#13
0
 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('')
 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)
示例#15
0
 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: True)
     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)
    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'])
示例#17
0
 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('')
    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'])
    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)

        self.flags(osapi_compute_extension=[
            'nova.api.openstack.compute.contrib.select_extensions'
        ],
                   osapi_compute_ext_list=['Extended_availability_zone'])
示例#20
0
 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'))
示例#21
0
 def test_rest_availability_zone_reset_cache(self):
     az.reset_cache()
     self.assertEqual(az._get_cache().get("cache"), None)
 def test_rest_availability_zone_reset_cache(self):
     az.reset_cache()
     self.assertEqual(az._get_cache().get('cache'), None)
 def test_rest_availability_zone_reset_cache(self):
     az._get_cache().region.get_or_create('cache', lambda: 'fake_value')
     az.reset_cache()
     self.assertIsNone(az._get_cache().get('cache'))
示例#24
0
 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'))
示例#25
0
 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"))