summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYoshihiro Kaneko <ykaneko0929@gmail.com>2014-05-13 19:20:11 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-05-14 13:19:16 +0900
commitf295487bef976e533de692c4d877e31344f6e595 (patch)
treebd86be6ffd65baef24a52be40814a893600467dc
parentf79634b3c705259408d9be24b45b4ba3dd42fa28 (diff)
topology/switches: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/topology/switches.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/ryu/topology/switches.py b/ryu/topology/switches.py
index 70226f19..4c66f0e4 100644
--- a/ryu/topology/switches.py
+++ b/ryu/topology/switches.py
@@ -473,7 +473,7 @@ class Switches(app_manager.RyuApp):
assert dp.id is not None
self.dps[dp.id] = dp
- if not dp.id in self.port_state:
+ if dp.id not in self.port_state:
self.port_state[dp.id] = PortState()
for port in dp.ports.values():
self.port_state[dp.id].add(port.port_no, port)
@@ -613,9 +613,9 @@ class Switches(app_manager.RyuApp):
ofpport = msg.desc
if reason == dp.ofproto.OFPPR_ADD:
- #LOG.debug('A port was added.' +
- # '(datapath id = %s, port number = %s)',
- # dp.id, ofpport.port_no)
+ # LOG.debug('A port was added.' +
+ # '(datapath id = %s, port number = %s)',
+ # dp.id, ofpport.port_no)
self.port_state[dp.id].add(ofpport.port_no, ofpport)
self.send_event_to_observers(
event.EventPortAdd(Port(dp.id, dp.ofproto, ofpport)))
@@ -629,9 +629,9 @@ class Switches(app_manager.RyuApp):
self.lldp_event.set()
elif reason == dp.ofproto.OFPPR_DELETE:
- #LOG.debug('A port was deleted.' +
- # '(datapath id = %s, port number = %s)',
- # dp.id, ofpport.port_no)
+ # LOG.debug('A port was deleted.' +
+ # '(datapath id = %s, port number = %s)',
+ # dp.id, ofpport.port_no)
self.port_state[dp.id].remove(ofpport.port_no)
self.send_event_to_observers(
event.EventPortDelete(Port(dp.id, dp.ofproto, ofpport)))
@@ -647,9 +647,9 @@ class Switches(app_manager.RyuApp):
else:
assert reason == dp.ofproto.OFPPR_MODIFY
- #LOG.debug('A port was modified.' +
- # '(datapath id = %s, port number = %s)',
- # dp.id, ofpport.port_no)
+ # LOG.debug('A port was modified.' +
+ # '(datapath id = %s, port number = %s)',
+ # dp.id, ofpport.port_no)
self.port_state[dp.id].modify(ofpport.port_no, ofpport)
self.send_event_to_observers(
event.EventPortModify(Port(dp.id, dp.ofproto, ofpport)))
@@ -725,7 +725,7 @@ class Switches(app_manager.RyuApp):
self.send_event_to_observers(event.EventLinkDelete(old_link))
link = Link(src, dst)
- if not link in self.links:
+ if link not in self.links:
self.send_event_to_observers(event.EventLinkAdd(link))
if not self.links.update_link(src, dst):