Signed-off-by: Isaku Yamahata <[email protected]>
---
bin/ryu-manager | 2 +-
ryu/controller/dpset.py | 24 ++++++++++--------------
2 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/bin/ryu-manager b/bin/ryu-manager
index f9bc562..cb57e62 100755
--- a/bin/ryu-manager
+++ b/bin/ryu-manager
@@ -50,7 +50,7 @@ def main():
log.init_log()
nw = network.Network()
- dpset_ = dpset.create_dpset()
+ dpset_ = dpset.DPSet()
app_mgr = AppManager()
app_mgr.load_apps(FLAGS.app_lists, network=nw, dpset=dpset_)
diff --git a/ryu/controller/dpset.py b/ryu/controller/dpset.py
index e5ef819..80ffb6f 100644
--- a/ryu/controller/dpset.py
+++ b/ryu/controller/dpset.py
@@ -25,6 +25,11 @@ from ryu.controller.handler import set_ev_cls
LOG = logging.getLogger('ryu.controller.dpset')
+QUEUE_NAME_DPSET = 'dpset'
+DISPATCHER_NAME_DPSET = 'dpset'
+DPSET_EV_DISPATCHER = dispatcher.EventDispatcher(DISPATCHER_NAME_DPSET)
+
+
class EventDPBase(event.EventBase):
def __init__(self, dp):
super(EventDPBase, self).__init__()
@@ -42,15 +47,16 @@ class EventDP(EventDPBase):
# this depends on controller::Datapath and dispatchers in handler
class DPSet(object):
- def __init__(self, ev_q, dispatcher_):
+ def __init__(self):
+ super(DPSet, self).__init__()
+
# 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.ev_q = ev_q
- self.dispatcher = dispatcher_
-
+ self.ev_q = dispatcher.EventQueue(QUEUE_NAME_DPSET,
+ DPSET_EV_DISPATCHER)
handler.register_instance(self)
def register(self, dp):
@@ -102,13 +108,3 @@ class DPSet(object):
elif ev.new_dispatcher.name == handler.DISPATCHER_NAME_OFP_DEAD:
LOG.debug('DPSET: unregister datapath %s', datapath)
self.unregister(datapath)
-
-
-DISPATCHER_NAME_DPSET = 'dpset'
-DPSET_EV_DISPATCHER = dispatcher.EventDispatcher(DISPATCHER_NAME_DPSET)
-QUEUE_NAME_DPSET = 'datapath'
-_DPSET_EV_Q = dispatcher.EventQueue(QUEUE_NAME_DPSET, DPSET_EV_DISPATCHER)
-
-
-def create_dpset():
- return DPSet(_DPSET_EV_Q, DPSET_EV_DISPATCHER)
--
1.7.1.1
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel