コード例 #1
0
ファイル: test_database.py プロジェクト: LuizOz/quantum
 def teste_test_vlanids(self):
     """test vlanid methods"""
     l2network_db.create_vlanids()
     vlanids = l2network_db.get_all_vlanids()
     self.assertTrue(len(vlanids) > 0)
     vlanid = l2network_db.reserve_vlanid()
     used = l2network_db.is_vlanid_used(vlanid)
     self.assertTrue(used)
     used = l2network_db.release_vlanid(vlanid)
     self.assertFalse(used)
コード例 #2
0
ファイル: test_database.py プロジェクト: hongbin/quantum
 def teste_test_vlanids(self):
     """test vlanid methods"""
     l2network_db.create_vlanids()
     vlanids = l2network_db.get_all_vlanids()
     self.assertTrue(len(vlanids) > 0)
     vlanid = l2network_db.reserve_vlanid()
     used = l2network_db.is_vlanid_used(vlanid)
     self.assertTrue(used)
     used = l2network_db.release_vlanid(vlanid)
     self.assertFalse(used)
コード例 #3
0
ファイル: test_database.py プロジェクト: Milstein/quantum
 def test_vlanids(self):
     l2network_db.create_vlanids()
     vlanids = l2network_db.get_all_vlanids()
     self.assertGreater(len(vlanids), 0)
     vlanid = l2network_db.reserve_vlanid()
     used = l2network_db.is_vlanid_used(vlanid)
     self.assertTrue(used)
     used = l2network_db.release_vlanid(vlanid)
     self.assertFalse(used)
     self.teardown_vlanbinding()
     self.teardown_network()
コード例 #4
0
    def create_network(self, context, network):
        new_network = super(LinuxBridgePluginV2, self).create_network(context,
                                                                      network)
        try:
            vlan_id = cdb.reserve_vlanid()
            cdb.add_vlan_binding(vlan_id, new_network['id'])
        except:
            super(LinuxBridgePluginV2, self).delete_network(context,
                                                            new_network['id'])
            raise

        return new_network
コード例 #5
0
ファイル: lb_quantum_plugin.py プロジェクト: vbannai/quantum
    def create_network(self, context, network):
        net = super(LinuxBridgePluginV2, self).create_network(context, network)
        try:
            vlan_id = network["network"].get("provider:vlan_id")
            if vlan_id not in (None, attributes.ATTR_NOT_SPECIFIED):
                self._enforce_provider_set_auth(context, net)
                cdb.reserve_specific_vlanid(int(vlan_id))
            else:
                vlan_id = cdb.reserve_vlanid()
            cdb.add_vlan_binding(vlan_id, net["id"])
            self._extend_network_dict(context, net)
        except:
            super(LinuxBridgePluginV2, self).delete_network(context, net["id"])
            raise

        return net
コード例 #6
0
 def _get_vlan_for_tenant(self, tenant_id, **kwargs):
     """Get an available VLAN ID"""
     try:
         return cdb.reserve_vlanid()
     except:
         raise Exception("Failed to reserve VLAN ID for network")
コード例 #7
0
 def _get_vlan_for_tenant(self, tenant_id, **kwargs):
     """Get an available VLAN ID"""
     try:
         return cdb.reserve_vlanid()
     except:
         raise Exception("Failed to reserve VLAN ID for network")