mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-01-24 18:11:24 +01:00
dpset: remove dead code
this "dp_type" stuff has been there for almost 2 years without being used at all. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
8aa44aa324
commit
be9ebaf431
@ -1,27 +0,0 @@
|
||||
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
|
||||
# Copyright (C) 2012 Isaku Yamahata <yamahata at valinux co jp>
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
#
|
||||
# datapath type
|
||||
# At this moment, this information is not used yet and unknown type is
|
||||
# defined as place-holder.
|
||||
# switches are categorized by its rolls and openflow controller may want to
|
||||
# handle switch differently depending on it role.
|
||||
#
|
||||
# unknown:
|
||||
#
|
||||
|
||||
UNKNOWN = 'UNKNOWN'
|
||||
@ -18,7 +18,6 @@ import logging
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import event
|
||||
from ryu.controller import dp_type
|
||||
from ryu.controller import handler
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
@ -88,10 +87,6 @@ class DPSet(app_manager.RyuApp):
|
||||
super(DPSet, self).__init__()
|
||||
self.name = 'dpset'
|
||||
|
||||
# dp registration and type setting can be occur in any order
|
||||
# Sometimes the sw_type is set before dp connection
|
||||
self.dp_types = {}
|
||||
|
||||
self.dps = {} # datapath_id => class Datapath
|
||||
self.port_state = {} # datapath_id => ports
|
||||
|
||||
@ -99,10 +94,6 @@ class DPSet(app_manager.RyuApp):
|
||||
assert dp.id is not None
|
||||
assert dp.id not in self.dps
|
||||
|
||||
dp_type_ = self.dp_types.pop(dp.id, None)
|
||||
if dp_type_ is not None:
|
||||
dp.dp_type = dp_type_
|
||||
|
||||
self.dps[dp.id] = dp
|
||||
self.port_state[dp.id] = PortState()
|
||||
ev = EventDP(dp, True)
|
||||
@ -124,16 +115,6 @@ class DPSet(app_manager.RyuApp):
|
||||
if dp.id in self.dps:
|
||||
del self.dps[dp.id]
|
||||
del self.port_state[dp.id]
|
||||
assert dp.id not in self.dp_types
|
||||
self.dp_types[dp.id] = getattr(dp, 'dp_type', dp_type.UNKNOWN)
|
||||
|
||||
def set_type(self, dp_id, dp_type_=dp_type.UNKNOWN):
|
||||
if dp_id in self.dps:
|
||||
dp = self.dps[dp_id]
|
||||
dp.dp_type = dp_type_
|
||||
else:
|
||||
assert dp_id not in self.dp_types
|
||||
self.dp_types[dp_id] = dp_type_
|
||||
|
||||
def get(self, dp_id):
|
||||
return self.dps.get(dp_id)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user