Signed-off-by: Yoshihiro Kaneko <[email protected]>
---
 ryu/app/ofctl/service.py       |   10 +++++-----
 ryu/app/ofctl_rest.py          |    8 ++++----
 ryu/app/rest.py                |    4 ++--
 ryu/app/rest_firewall.py       |   15 ++++++++-------
 ryu/app/rest_router.py         |   30 +++++++++++++++---------------
 ryu/app/tunnel_port_updater.py |   11 ++++++-----
 6 files changed, 40 insertions(+), 38 deletions(-)

diff --git a/ryu/app/ofctl/service.py b/ryu/app/ofctl/service.py
index 415834e..cb82d72 100644
--- a/ryu/app/ofctl/service.py
+++ b/ryu/app/ofctl/service.py
@@ -107,7 +107,7 @@ class OfctlService(app_manager.RyuApp):
 
     @set_ev_cls(event.SendMsgRequest, MAIN_DISPATCHER)
     def _handle_send_msg(self, req):
-        if not req.reply_cls is None:
+        if req.reply_cls is not None:
             self._observe_msg(req.reply_cls)
 
         msg = req.msg
@@ -119,9 +119,9 @@ class OfctlService(app_manager.RyuApp):
         barrier_xid = barrier.xid
 
         si = self._switches[datapath.id]
-        assert not xid in si.results
-        assert not xid in si.xids
-        assert not barrier_xid in si.barriers
+        assert xid not in si.results
+        assert xid not in si.xids
+        assert barrier_xid not in si.barriers
         si.results[xid] = []
         si.xids[xid] = req
         si.barriers[barrier_xid] = xid
@@ -145,7 +145,7 @@ class OfctlService(app_manager.RyuApp):
             return
         result = si.results.pop(xid)
         req = si.xids.pop(xid)
-        if not req.reply_cls is None:
+        if req.reply_cls is not None:
             self._unobserve_msg(req.reply_cls)
         if any(self._is_error(r) for r in result):
             rep = event.Reply(exception=exception.OFError(result=result))
diff --git a/ryu/app/ofctl_rest.py b/ryu/app/ofctl_rest.py
index edef9a7..51c1eef 100644
--- a/ryu/app/ofctl_rest.py
+++ b/ryu/app/ofctl_rest.py
@@ -36,7 +36,8 @@ LOG = logging.getLogger('ryu.app.ofctl_rest')
 
 # REST API
 #
-## Retrieve the switch stats
+
+# Retrieve the switch stats
 #
 # get the list of all switches
 # GET /stats/switches
@@ -67,9 +68,8 @@ LOG = logging.getLogger('ryu.app.ofctl_rest')
 #
 # get groups stats of the switch
 # GET /stats/group/<dpid>
-#
-#
-## Update the switch stats
+
+# Update the switch stats
 #
 # add a flow entry
 # POST /stats/flowentry/add
diff --git a/ryu/app/rest.py b/ryu/app/rest.py
index bd2142f..dd39494 100644
--- a/ryu/app/rest.py
+++ b/ryu/app/rest.py
@@ -34,8 +34,8 @@ from ryu.exception import PortNotFound, PortAlreadyExist
 from ryu.lib import dpid as dpid_lib
 from ryu.lib import mac as mac_lib
 
-## TODO:XXX
-## define db interface and store those information into db
+# TODO:XXX
+# define db interface and store those information into db
 
 # REST API
 
diff --git a/ryu/app/rest_firewall.py b/ryu/app/rest_firewall.py
index 3b4e3af..01eb6e2 100644
--- a/ryu/app/rest_firewall.py
+++ b/ryu/app/rest_firewall.py
@@ -42,16 +42,17 @@ from ryu.ofproto import ofproto_v1_3
 from ryu.ofproto import ofproto_v1_3_parser
 
 
-#=============================
+# =============================
 #          REST API
-#=============================
+# =============================
 #
 #  Note: specify switch and vlan group, as follows.
 #   {switch-id} : 'all' or switchID
 #   {vlan-id}   : 'all' or vlanID
 #
 #
-## about Firewall status
+
+# about Firewall status
 #
 # get status of all firewall switches
 # GET /firewall/module/status
@@ -62,8 +63,8 @@ from ryu.ofproto import ofproto_v1_3_parser
 # set disable the firewall switches
 # PUT /firewall/module/disable/{switch-id}
 #
-#
-## about Firewall logs
+
+# about Firewall logs
 #
 # get log status of all firewall switches
 # GET /firewall/log/status
@@ -74,8 +75,8 @@ from ryu.ofproto import ofproto_v1_3_parser
 # set log disable the firewall switches
 # PUT /firewall/log/disable/{switch-id}
 #
-#
-## about Firewall rules
+
+# about Firewall rules
 #
 # get rules of the firewall switches
 # * for no vlan
diff --git a/ryu/app/rest_router.py b/ryu/app/rest_router.py
index fb1e7d6..3a35923 100644
--- a/ryu/app/rest_router.py
+++ b/ryu/app/rest_router.py
@@ -49,16 +49,16 @@ from ryu.ofproto import ofproto_v1_2
 from ryu.ofproto import ofproto_v1_3
 
 
-#=============================
+# =============================
 #          REST API
-#=============================
+# =============================
 #
 #  Note: specify switch and vlan group, as follows.
 #   {switch_id} : 'all' or switchID
 #   {vlan_id}   : 'all' or vlanID
 #
-#
-## 1. get address data and routing data.
+
+# 1. get address data and routing data.
 #
 # * get data of no vlan
 # GET /router/{switch_id}
@@ -66,8 +66,8 @@ from ryu.ofproto import ofproto_v1_3
 # * get data of specific vlan group
 # GET /router/{switch_id}/{vlan_id}
 #
-#
-## 2. set address data or routing data.
+
+# 2. set address data or routing data.
 #
 # * set data of no vlan
 # POST /router/{switch_id}
@@ -82,8 +82,8 @@ from ryu.ofproto import ofproto_v1_3
 #  case2-2: set default route.
 #    parameter = {"gateway": "E.F.G.H"}
 #
-#
-## 3. delete address data or routing data.
+
+# 3. delete address data or routing data.
 #
 # * delete data of no vlan
 # DELETE /router/{switch_id}
@@ -297,7 +297,7 @@ class RestRouterAPI(app_manager.RyuApp):
     def stats_reply_handler_v1_2(self, ev):
         self._stats_reply_handler(ev)
 
-    #TODO: Update routing table when port status is changed.
+    # TODO: Update routing table when port status is changed.
 
 
 # REST command template
@@ -562,8 +562,8 @@ class Router(dict):
 
     def packet_in_handler(self, msg):
         pkt = packet.Packet(msg.data)
-        #TODO: Packet library convert to string
-        #self.logger.debug('Packet in = %s', str(pkt), self.sw_id)
+        # TODO: Packet library convert to string
+        # self.logger.debug('Packet in = %s', str(pkt), self.sw_id)
         header_list = dict((p.protocol_name, p)
                            for p in pkt.protocols if type(p) != str)
         if header_list:
@@ -1562,10 +1562,10 @@ class OfCtl(object):
         actions = [self.dp.ofproto_parser.OFPActionOutput(output, 0)]
         self.dp.send_packet_out(buffer_id=UINT32_MAX, in_port=in_port,
                                 actions=actions, data=data)
-        #TODO: Packet library convert to string
-        #if data_str is None:
-        #    data_str = str(packet.Packet(data))
-        #self.logger.debug('Packet out = %s', data_str, extra=self.sw_id)
+        # TODO: Packet library convert to string
+        # if data_str is None:
+        #     data_str = str(packet.Packet(data))
+        # self.logger.debug('Packet out = %s', data_str, extra=self.sw_id)
 
     def set_normal_flow(self, cookie, priority):
         out_port = self.dp.ofproto.OFPP_NORMAL
diff --git a/ryu/app/tunnel_port_updater.py b/ryu/app/tunnel_port_updater.py
index 3c1f5c8..0e8da30 100644
--- a/ryu/app/tunnel_port_updater.py
+++ b/ryu/app/tunnel_port_updater.py
@@ -245,11 +245,12 @@ class TunnelDP(object):
 
     # serialize requests to this OVS DP
     _RequestUpdateRemote = collections.namedtuple('_RequestUpdateRemote',
-                                                 ('remote_dpid', 'remote_ip'))
-    _RequestAddTunnelPort = collections.namedtuple('_RequestAddTunnelPort',
                                                   ('remote_dpid', 'remote_ip'))
+    _RequestAddTunnelPort = collections.namedtuple('_RequestAddTunnelPort',
+                                                   ('remote_dpid',
+                                                    'remote_ip'))
     _RequestDelTunnelPort = collections.namedtuple('_RequestDelTunnelPort',
-                                                  ('remote_ip'))
+                                                   ('remote_ip'))
 
     class _RequestClose(object):
         pass
@@ -325,8 +326,8 @@ class TunnelDPSet(dict):
     pass
 
 
-#import collections
-#class TunnelRequests(collections.defaultdict(set)):
+# import collections
+# class TunnelRequests(collections.defaultdict(set)):
 class TunnelRequests(dict):
     def add(self, dpid0, dpid1):
         self.setdefault(dpid0, set()).add(dpid1)
-- 
1.7.9.5


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to