예제 #1
0
 def get_controller_extensions(self):
     extension1 = extensions.ControllerExtension(
         self, 'microversions5', MicroversionsExtendsController1())
     extension2 = extensions.ControllerExtension(
         self, 'microversions5', MicroversionsExtendsController2())
     extension3 = extensions.ControllerExtension(
         self, 'microversions5', MicroversionsExtendsController3())
     return [extension1, extension2, extension3]
예제 #2
0
    def get_controller_extensions(self):
        servers_extension = extensions.ControllerExtension(
            self, 'servers', ServerDiskConfigController())

        images_extension = extensions.ControllerExtension(
            self, 'images', ImageDiskConfigController())

        return [servers_extension, images_extension]
예제 #3
0
    def get_controller_extensions(self):
        extension_list = []

        extension_set = [
            (FoxInSocksServerControllerExtension, 'servers'),
            (FoxInSocksFlavorGooseControllerExtension, 'flavors'),
            (FoxInSocksFlavorBandsControllerExtension, 'flavors'),
        ]
        for klass, collection in extension_set:
            controller = klass()
            ext = extensions.ControllerExtension(self, collection, controller)
            extension_list.append(ext)

        return extension_list
예제 #4
0
 def test_controller_extension_early(self):
     controller = StubController(response_body)
     res_ext = base_extensions.ResourceExtension('tweedles', controller)
     ext_controller = StubEarlyExtensionController(extension_body)
     extension = StubControllerExtension()
     cont_ext = base_extensions.ControllerExtension(extension, 'tweedles',
                                                    ext_controller)
     manager = StubExtensionManager(resource_ext=res_ext,
                                    controller_ext=cont_ext)
     app = compute.APIRouter(manager)
     request = webob.Request.blank("/fake/tweedles")
     response = request.get_response(app)
     self.assertEqual(200, response.status_int)
     self.assertEqual(extension_body, response.body)
예제 #5
0
    def test_controller_extension_late(self):
        # Need a dict for the body to convert to a ResponseObject
        controller = StubController(dict(foo=response_body))
        res_ext = base_extensions.ResourceExtension('tweedles', controller)

        ext_controller = StubLateExtensionController(extension_body)
        extension = StubControllerExtension()
        cont_ext = base_extensions.ControllerExtension(extension, 'tweedles',
                                                       ext_controller)

        manager = StubExtensionManager(resource_ext=res_ext,
                                       controller_ext=cont_ext)
        app = compute.APIRouter(manager)
        request = webob.Request.blank("/fake/tweedles")
        response = request.get_response(app)
        self.assertEqual(200, response.status_int)
        self.assertEqual(extension_body, response.body)
예제 #6
0
    def test_get_resources_with_stub_mgr(self):
        class GooGoose(wsgi.Controller):
            @wsgi.extends
            def show(self, req, resp_obj, id):
                # only handle JSON responses
                resp_obj.obj['flavor']['googoose'] = req.GET.get('chewing')

        req_ext = base_extensions.ControllerExtension(
            StubControllerExtension(), 'flavors', GooGoose())

        manager = StubExtensionManager(None, None, None, req_ext)
        app = fakes.wsgi_app(ext_mgr=manager)
        request = webob.Request.blank("/v2/fake/flavors/1?chewing=bluegoo")
        request.environ['api.version'] = '2'
        response = request.get_response(app)
        self.assertEqual(200, response.status_int)
        response_data = jsonutils.loads(response.body)
        self.assertEqual('bluegoo', response_data['flavor']['googoose'])
예제 #7
0
 def test_controller_action_extension_early(self):
     controller = StubActionController(response_body)
     actions = dict(action='POST')
     res_ext = base_extensions.ResourceExtension('tweedles',
                                                 controller,
                                                 member_actions=actions)
     ext_controller = StubEarlyExtensionController(extension_body)
     extension = StubControllerExtension()
     cont_ext = base_extensions.ControllerExtension(extension, 'tweedles',
                                                    ext_controller)
     manager = StubExtensionManager(resource_ext=res_ext,
                                    controller_ext=cont_ext)
     app = compute.APIRouter(manager)
     request = webob.Request.blank("/fake/tweedles/foo/action")
     request.method = 'POST'
     request.headers['Content-Type'] = 'application/json'
     request.body = jsonutils.dump_as_bytes(dict(fooAction=True))
     response = request.get_response(app)
     self.assertEqual(200, response.status_int)
     self.assertEqual(extension_body, response.body)
예제 #8
0
 def get_controller_extensions(self):
     controller = ExtendedServerVIFNetController()
     extension = extensions.ControllerExtension(self,
                                                'os-virtual-interfaces',
                                                controller)
     return [extension]
예제 #9
0
 def get_controller_extensions(self):
     return [extensions.ControllerExtension(self, 'servers', Controller())]
예제 #10
0
 def get_controller_extensions(self):
     controller = SecurityGroupActionController()
     actions = extensions.ControllerExtension(self, 'servers', controller)
     controller = SecurityGroupsOutputController()
     output = extensions.ControllerExtension(self, 'servers', controller)
     return [actions, output]
예제 #11
0
 def get_controller_extensions(self):
     controller = EvacuateController()
     extension = extensions.ControllerExtension(self, 'servers', controller)
     return [extension]
예제 #12
0
 def get_controller_extensions(self):
     controller = ExtendedIpsMacController()
     extension = extensions.ControllerExtension(self, 'servers', controller)
     return [extension]
예제 #13
0
    def get_controller_extensions(self):
        extension = extensions.ControllerExtension(
                self, 'os-networks', NetworkAssociateActionController())

        return [extension]
예제 #14
0
 def get_controller_extensions(self):
     controller = MultinicController()
     extension = extensions.ControllerExtension(self, 'servers', controller)
     return [extension]
예제 #15
0
 def get_controller_extensions(self):
     controller = UsedLimitsController()
     limits_ext = extensions.ControllerExtension(self,
                                                 'limits',
                                                 controller=controller)
     return [limits_ext]
예제 #16
0
 def get_controller_extensions(self):
     controller = AdminActionsController()
     extension = extensions.ControllerExtension(self, 'servers', controller)
     return [extension]
예제 #17
0
 def get_controller_extensions(self):
     controller = CloudpipeUpdateController()
     extension = extensions.ControllerExtension(self, 'os-cloudpipe',
                                                controller)
     return [extension]
예제 #18
0
 def get_controller_extensions(self):
     controller = SchedulerHintsController()
     ext = extensions.ControllerExtension(self, 'servers', controller)
     return [ext]
예제 #19
0
 def get_controller_extensions(self):
     controller = ImageSizeController()
     extension = extensions.ControllerExtension(self, 'images', controller)
     return [extension]
예제 #20
0
 def get_controller_extensions(self):
     controller = ServerStartStopActionController()
     extension = extensions.ControllerExtension(self, 'servers', controller)
     return [extension]
예제 #21
0
    def get_controller_extensions(self):
        extension = extensions.ControllerExtension(self, 'flavors',
                                                   FlavorActionController())

        return [extension]
예제 #22
0
 def get_controller_extensions(self):
     controller = Controller(self.ext_mgr)
     extension = extensions.ControllerExtension(self, 'servers', controller)
     return [extension]
예제 #23
0
 def get_controller_extensions(self):
     controller = RemoteConsolesController()
     extension = extensions.ControllerExtension(self, 'servers', controller)
     return [extension]
예제 #24
0
 def get_controller_extensions(self):
     controller = PauseServerController()
     extension = extensions.ControllerExtension(self, 'servers', controller)
     return [extension]
예제 #25
0
 def get_controller_extensions(self):
     controller = ExtendedServerAttributesController()
     extension = extensions.ControllerExtension(self, 'servers', controller)
     return [extension]
예제 #26
0
파일: pci.py 프로젝트: bopopescu/jacket
 def get_controller_extensions(self):
     server_extension = extensions.ControllerExtension(
         self, 'servers', PciServerController())
     compute_extension = extensions.ControllerExtension(
         self, 'os-hypervisors', PciHypervisorController())
     return [server_extension, compute_extension]
예제 #27
0
 def get_controller_extensions(self):
     controller = FlavorManageController()
     extension = extensions.ControllerExtension(self, 'flavors', controller)
     return [extension]
예제 #28
0
 def get_controller_extensions(self):
     controller = DeferredDeleteController()
     extension = extensions.ControllerExtension(self, 'servers', controller)
     return [extension]
예제 #29
0
 def get_controller_extensions(self):
     extension_list = [
         extensions.ControllerExtension(self, 'limits',
                                        ExtendedLimitsController()),
     ]
     return extension_list
예제 #30
0
 def get_controller_extensions(self):
     controller = FloatingIPActionController()
     extension = extensions.ControllerExtension(self, 'servers', controller)
     return [extension]