Exemple #1
0
 def _setup(self):
     ext_mgr = extensions.ExtensionManager()
     ext_mgr.extensions = {'os-extended-networks': 'fake'}
     self.controller = networks.NetworkController(self.fake_network_api,
                                                  ext_mgr)
     self.neutron_ctrl = networks.NetworkController(
         neutron.API(skip_policy_check=False))
 def _setup(self):
     ext_mgr = extensions.ExtensionManager()
     ext_mgr.extensions = {'os-extended-networks': 'fake'}
     self.controller = networks.NetworkController(self.fake_network_api,
                                                  ext_mgr)
     self.neutron_ctrl = networks.NetworkController(
         neutron.API(skip_policy_check=False))
     self.req = fakes.HTTPRequest.blank('', use_admin_context=True)
Exemple #3
0
 def _setup(self):
     ext_mgr = extensions.ExtensionManager()
     ext_mgr.extensions = {'os-extended-networks': 'fake'}
     self.controller = networks.NetworkController(self.fake_network_api,
                                                  ext_mgr)
     self.associate_controller = networks_associate\
         .NetworkAssociateActionController(self.fake_network_api)
Exemple #4
0
 def test_network_neutron_disassociate_not_implemented(self):
     uuid = FAKE_NETWORKS[1]['uuid']
     self.flags(network_api_class='nova.network.neutronv2.api.API')
     controller = networks.NetworkController()
     self.assertRaises(webob.exc.HTTPNotImplemented,
                       controller._disassociate_host_and_project, self.req,
                       uuid, {'disassociate': None})
Exemple #5
0
 def _setup(self):
     self.controller = networks.NetworkController(self.fake_network_api)
     self.associate_controller = networks_associate_v21\
         .NetworkAssociateActionController(self.fake_network_api)
     self.neutron_assoc_ctrl = (
         networks_associate_v21.NetworkAssociateActionController(
             neutron.API(skip_policy_check=True)))
    def _setup(self):
        ext_mgr = extensions.ExtensionManager()
        ext_mgr.extensions = {'os-extended-networks': 'fake'}
        self.req = fakes.HTTPRequest.blank('', use_admin_context=True)

        self.controller = networks.NetworkController(self.PassthroughAPI(),
                                                     ext_mgr)
Exemple #7
0
 def setUp(self):
     super(NetworksTest, self).setUp()
     self.fake_network_api = FakeNetworkAPI()
     self.controller = networks.NetworkController(self.fake_network_api)
     self.associate_controller = networks_associate\
         .NetworkAssociateActionController(self.fake_network_api)
     fakes.stub_out_networking(self.stubs)
     fakes.stub_out_rate_limiting(self.stubs)
Exemple #8
0
 def test_network_neutron_disassociate_not_implemented(self):
     uuid = FAKE_NETWORKS[1]['uuid']
     self.flags(network_api_class='nova.network.neutronv2.api.API')
     controller = networks.NetworkController()
     req = fakes.HTTPRequest.blank('/v2/1234/os-networks/%s/action' % uuid)
     self.assertRaises(webob.exc.HTTPNotImplemented,
                       controller._disassociate_host_and_project,
                       req, uuid, {'disassociate': None})
Exemple #9
0
 def setUp(self):
     super(NetworksTest, self).setUp()
     self.fake_network_api = FakeNetworkAPI()
     ext_mgr = extensions.ExtensionManager()
     ext_mgr.extensions = {'os-extended-networks': 'fake'}
     self.controller = networks.NetworkController(self.fake_network_api,
                                                  ext_mgr)
     self.associate_controller = networks_associate\
         .NetworkAssociateActionController(self.fake_network_api)
     fakes.stub_out_networking(self.stubs)
     fakes.stub_out_rate_limiting(self.stubs)
Exemple #10
0
    def setUp(self):
        super(NetworkCreateExceptionsTest, self).setUp()
        ext_mgr = extensions.ExtensionManager()
        ext_mgr.extensions = {'os-extended-networks': 'fake'}

        class PassthroughAPI():
            def __init__(self):
                self.network_manager = manager.FlatDHCPManager()

            def create(self, *args, **kwargs):
                return self.network_manager.create_networks(*args, **kwargs)

        self.controller = networks.NetworkController(PassthroughAPI(), ext_mgr)
        fakes.stub_out_networking(self.stubs)
        fakes.stub_out_rate_limiting(self.stubs)
Exemple #11
0
 def _setup(self):
     self.controller = networks.NetworkController(self.fake_network_api)
     self.associate_controller = networks_associate_v21\
         .NetworkAssociateActionController(self.fake_network_api)
Exemple #12
0
 def _setup(self):
     ext_mgr = extensions.ExtensionManager()
     ext_mgr.extensions = {'os-extended-networks': 'fake'}
     self.controller = networks.NetworkController(self.fake_network_api,
                                                  ext_mgr)
Exemple #13
0
    def _setup(self):
        ext_mgr = extensions.ExtensionManager()
        ext_mgr.extensions = {'os-extended-networks': 'fake'}

        self.controller = networks.NetworkController(self.PassthroughAPI(),
                                                     ext_mgr)