Browse Source

Remove model completely from stackforge leave in neutron.

Fixes bug: #1427919

Change-Id: I105aeeaa5b5023097e4b2eb1abccf0cd499cb806
Shiv Haris 4 years ago
parent
commit
5c728cb4fe

+ 0
- 0
networking_brocade/vdx/ml2driver/db/__init__.py View File


+ 0
- 135
networking_brocade/vdx/ml2driver/db/models.py View File

@@ -1,135 +0,0 @@
1
-# Copyright 2014 Brocade Communications System, Inc.
2
-# All rights reserved.
3
-#
4
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
-#    not use this file except in compliance with the License. You may obtain
6
-#    a copy of the License at
7
-#
8
-#         http://www.apache.org/licenses/LICENSE-2.0
9
-#
10
-#    Unless required by applicable law or agreed to in writing, software
11
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
-#    License for the specific language governing permissions and limitations
14
-#    under the License.
15
-
16
-
17
-"""Brocade specific database schema/model."""
18
-
19
-from neutron.db import model_base
20
-from neutron.db import models_v2
21
-import sqlalchemy as sa
22
-
23
-
24
-class ML2_BrocadeNetwork(model_base.BASEV2, models_v2.HasId,
25
-                         models_v2.HasTenant):
26
-    """Schema for brocade network."""
27
-
28
-    vlan = sa.Column(sa.String(10))
29
-    segment_id = sa.Column(sa.String(36))
30
-    network_type = sa.Column(sa.String(10))
31
-
32
-
33
-class ML2_BrocadePort(model_base.BASEV2, models_v2.HasId,
34
-                      models_v2.HasTenant):
35
-    """Schema for brocade port."""
36
-
37
-    network_id = sa.Column(sa.String(36),
38
-                           sa.ForeignKey("ml2_brocadenetworks.id"),
39
-                           nullable=False)
40
-    admin_state_up = sa.Column(sa.Boolean, nullable=False)
41
-    physical_interface = sa.Column(sa.String(36))
42
-    vlan_id = sa.Column(sa.String(36))
43
-
44
-
45
-def create_network(context, net_id, vlan, segment_id, network_type, tenant_id):
46
-    """Create a brocade specific network/port-profiles."""
47
-
48
-    # only network_type of vlan is supported
49
-    session = context.session
50
-    with session.begin(subtransactions=True):
51
-        net = get_network(context, net_id, None)
52
-        if not net:
53
-            net = ML2_BrocadeNetwork(id=net_id, vlan=vlan,
54
-                                     segment_id=segment_id,
55
-                                     network_type='vlan',
56
-                                     tenant_id=tenant_id)
57
-            session.add(net)
58
-    return net
59
-
60
-
61
-def delete_network(context, net_id):
62
-    """Delete a brocade specific network/port-profiles."""
63
-
64
-    session = context.session
65
-    with session.begin(subtransactions=True):
66
-        net = get_network(context, net_id, None)
67
-        if net:
68
-            session.delete(net)
69
-
70
-
71
-def get_network(context, net_id, fields=None):
72
-    """Get brocade specific network, with vlan extension."""
73
-
74
-    session = context.session
75
-    return session.query(ML2_BrocadeNetwork).filter_by(id=net_id).first()
76
-
77
-
78
-def get_networks(context, filters=None, fields=None):
79
-    """Get all brocade specific networks."""
80
-
81
-    session = context.session
82
-    return session.query(ML2_BrocadeNetwork).all()
83
-
84
-
85
-def create_port(context, port_id, network_id, physical_interface,
86
-                vlan_id, tenant_id, admin_state_up):
87
-    """Create a brocade specific port, has policy like vlan."""
88
-
89
-    session = context.session
90
-    with session.begin(subtransactions=True):
91
-        port = get_port(context, port_id)
92
-        if not port:
93
-            port = ML2_BrocadePort(id=port_id,
94
-                                   network_id=network_id,
95
-                                   physical_interface=physical_interface,
96
-                                   vlan_id=vlan_id,
97
-                                   admin_state_up=admin_state_up,
98
-                                   tenant_id=tenant_id)
99
-            session.add(port)
100
-
101
-    return port
102
-
103
-
104
-def get_port(context, port_id):
105
-    """get a brocade specific port."""
106
-
107
-    session = context.session
108
-    return session.query(ML2_BrocadePort).filter_by(id=port_id).first()
109
-
110
-
111
-def get_ports(context, network_id=None):
112
-    """get a brocade specific port."""
113
-
114
-    session = context.session
115
-    return session.query(ML2_BrocadePort).filter_by(
116
-        network_id=network_id).all()
117
-
118
-
119
-def delete_port(context, port_id):
120
-    """delete brocade specific port."""
121
-
122
-    session = context.session
123
-    with session.begin(subtransactions=True):
124
-        port = get_port(context, port_id)
125
-        if port:
126
-            session.delete(port)
127
-
128
-
129
-def update_port_state(context, port_id, admin_state_up):
130
-    """Update port attributes."""
131
-
132
-    session = context.session
133
-    with session.begin(subtransactions=True):
134
-        session.query(ML2_BrocadePort).filter_by(
135
-            id=port_id).update({'admin_state_up': admin_state_up})

+ 1
- 1
networking_brocade/vdx/ml2driver/mechanism_brocade.py View File

@@ -16,11 +16,11 @@
16 16
 
17 17
 """Implentation of Brocade ML2 Mechanism driver for ML2 Plugin."""
18 18
 
19
-from networking_brocade.vdx.ml2driver.db import models as brocade_db
20 19
 from neutron.i18n import _LE
21 20
 from neutron.i18n import _LI
22 21
 from neutron.openstack.common import log as logging
23 22
 from neutron.plugins.ml2 import driver_api
23
+from neutron.plugins.ml2.drivers.brocade.db import models as brocade_db
24 24
 from oslo_config import cfg
25 25
 from oslo_utils import importutils
26 26
 

Loading…
Cancel
Save