Skip to content

Commit

Permalink
Fix the misuse of operator
Browse files Browse the repository at this point in the history
  • Loading branch information
hsiaohsuan1l1l committed May 19, 2016
1 parent 884639f commit 61c10ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions adapter/ryu/omniui/omniui.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def packet_in_handler(self, ev):
packetIn["ip_dst"] = p.dst_ip

if hasattr(p, 'proto'):
packetIn["protocol"] = 'x0'.join(hex(p.proto).split('x')) if ((len(hex(p.proto)) < 4) | (len(hex(p.proto)) == 5)) else hex(p.proto)
packetIn["protocol"] = 'x0'.join(hex(p.proto).split('x')) if ((len(hex(p.proto)) < 4) or (len(hex(p.proto)) == 5)) else hex(p.proto)

if hasattr(p, 'src_port'):
packetIn["port_src"] = str(p.src_port)
Expand Down Expand Up @@ -726,7 +726,7 @@ def ryuFlow_v1_0(self, dp, flows):
action = self.to_action_v1_0(dp, act)
ryuFlow['actions'].append(action)
for matchfield in ryuFlow['match'].copy():
if (ryuFlow['match'][matchfield] == 0) | (ryuFlow['match'][matchfield] == '0.0.0.0') | (ryuFlow['match'][matchfield] == '00:00:00:00:00:00'):
if (ryuFlow['match'][matchfield] == 0) or (ryuFlow['match'][matchfield] == '0.0.0.0') or (ryuFlow['match'][matchfield] == '00:00:00:00:00:00'):
del ryuFlow['match'][matchfield]

return ryuFlow
Expand Down Expand Up @@ -889,7 +889,7 @@ def to_match_v1_3(self, dp, omni_key, omniFlow):
'ipv6_exthdr': ['ipv6_exthdr', int]
}

if (omniFlow.get(omni_key) == '0') | (omniFlow.get(omni_key) == '0.0.0.0') | (omniFlow.get(omni_key) == '00:00:00:00:00:00') | (omniFlow.get(omni_key) == '0x00') | (omniFlow.get(omni_key) == '0x0000'):
if (omniFlow.get(omni_key) == '0') or (omniFlow.get(omni_key) == '0.0.0.0') or (omniFlow.get(omni_key) == '00:00:00:00:00:00') or (omniFlow.get(omni_key) == '0x00') or (omniFlow.get(omni_key) == '0x0000'):
return None
for key, value in convert.items():
if omni_key == key:
Expand Down
4 changes: 2 additions & 2 deletions core/src/floodlight_modules/busylink_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ def busyLinkDetect(self):
destp = self.links[link_id]['targetPort']

# Check if needed information all arrived
if (src not in self.switches) | (dest not in self.switches):
if (src not in self.switches) or (dest not in self.switches):
print 'Not Ready'
return
elif (srcp not in self.switches[src]) | (destp not in self.switches[dest]):
elif (srcp not in self.switches[src]) or (destp not in self.switches[dest]):
print 'Not Ready'
return

Expand Down

0 comments on commit 61c10ad

Please sign in to comment.