summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2013-04-04 12:28:05 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-04-07 11:11:17 +0900
commit3d8d88e5dcaad252060bd6632c5f5c513dd23539 (patch)
tree67fe5a6ba0071f667ef9ac4d1a2683f437feba04
parent48b2665795615920b8aec583f62bd097eb656fb5 (diff)
ryu/topology/switches: simplify Switches with RyuApp.reply_to_request
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/topology/switches.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/ryu/topology/switches.py b/ryu/topology/switches.py
index d507506b..b5584dca 100644
--- a/ryu/topology/switches.py
+++ b/ryu/topology/switches.py
@@ -800,10 +800,7 @@ class Switches(app_manager.RyuApp):
switches.append(self._get_switch(dpid))
rep = event.EventSwitchReply(req.src, switches)
- if req.sync:
- self.send_reply(rep)
- else:
- self.send_event(req.src, rep)
+ self.reply_to_request(req, rep)
@set_ev_cls(event.EventLinkRequest)
def link_request_handler(self, req):
@@ -815,10 +812,7 @@ class Switches(app_manager.RyuApp):
else:
links = [link for link in self.links if link.src.dpid == dpid]
rep = event.EventLinkReply(req.src, dpid, links)
- if req.sync:
- self.send_reply(rep)
- else:
- self.send_event(req.src, rep)
+ self.reply_to_request(req, rep)
def get_switch(app, dpid=None):