summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorwatanabe.fumitaka <watanabe.fumitaka@nttcom.co.jp>2013-09-10 11:28:37 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-09-14 08:06:50 +0900
commit8408253ff40c55b68d3a064a9bbda80baadfbbd1 (patch)
tree3e30383877c6d57547e623862f523367dd01c5be
parent990072dbb21e4a7c5d97b13390fae72d3cee053c (diff)
rest_firewall: remove of a redundant code
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/app/rest_firewall.py40
1 files changed, 4 insertions, 36 deletions
diff --git a/ryu/app/rest_firewall.py b/ryu/app/rest_firewall.py
index 0a23e038..1ca6cad4 100644
--- a/ryu/app/rest_firewall.py
+++ b/ryu/app/rest_firewall.py
@@ -387,48 +387,16 @@ class FirewallController(ControllerBase):
# GET /firewall/module/status
def get_status(self, req, **_kwargs):
- try:
- dps = self._OFS_LIST.get_ofs(REST_ALL)
- except ValueError, message:
- return Response(status=400, body=str(message))
-
- msgs = {}
- for f_ofs in dps.values():
- status = f_ofs.get_status(self.waiters)
- msgs.update(status)
-
- body = json.dumps(msgs)
- return Response(content_type='application/json', body=body)
+ return self._access_module(REST_ALL, 'get_status',
+ waiters=self.waiters)
# POST /firewall/module/enable/{switchid}
def set_enable(self, req, switchid, **_kwargs):
- try:
- dps = self._OFS_LIST.get_ofs(switchid)
- except ValueError, message:
- return Response(status=400, body=str(message))
-
- msgs = {}
- for f_ofs in dps.values():
- msg = f_ofs.set_enable_flow()
- msgs.update(msg)
-
- body = json.dumps(msgs)
- return Response(content_type='application/json', body=body)
+ return self._access_module(switchid, 'set_enable_flow')
# POST /firewall/module/disable/{switchid}
def set_disable(self, req, switchid, **_kwargs):
- try:
- dps = self._OFS_LIST.get_ofs(switchid)
- except ValueError, message:
- return Response(status=400, body=str(message))
-
- msgs = {}
- for f_ofs in dps.values():
- msg = f_ofs.set_disable_flow()
- msgs.update(msg)
-
- body = json.dumps(msgs)
- return Response(content_type='application/json', body=body)
+ return self._access_module(switchid, 'set_disable_flow')
# GET /firewall/log/status
def get_log_status(self, dummy, **_kwargs):