Signed-off-by: Satoshi Kobayashi <[email protected]>
---
ryu/lib/type_desc.py | 2 +-
ryu/ofproto/nx_actions.py | 4 ++--
ryu/ofproto/oxm_fields.py | 2 +-
ryu/tests/unit/packet/test_icmpv6.py | 28 ++++++++++++++--------------
4 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/ryu/lib/type_desc.py b/ryu/lib/type_desc.py
index 4aa6fc0..6499f32 100644
--- a/ryu/lib/type_desc.py
+++ b/ryu/lib/type_desc.py
@@ -38,7 +38,7 @@ class IntDescr(TypeDescr):
bin = ''
for x in range(self.size):
bin = chr(i & 255) + bin
- i /= 256
+ i //= 256
return bin
Int1 = IntDescr(1)
diff --git a/ryu/ofproto/nx_actions.py b/ryu/ofproto/nx_actions.py
index b097a23..acba3c6 100644
--- a/ryu/ofproto/nx_actions.py
+++ b/ryu/ofproto/nx_actions.py
@@ -62,7 +62,7 @@ def generate(ofp_name, ofpp_name):
src = cls._parse_subfield(rest)
rest = rest[6:]
elif src_type == 1: # immediate
- src_len = (n_bits + 15) / 16 * 2
+ src_len = (n_bits + 15) // 16 * 2
src_bin = rest[:src_len]
src = type_desc.IntDescr(size=src_len).to_user(src_bin)
rest = rest[src_len:]
@@ -89,7 +89,7 @@ def generate(ofp_name, ofpp_name):
if src_type == 0: # subfield
buf += self._serialize_subfield(self.src)
elif src_type == 1: # immediate
- src_len = (self.n_bits + 15) / 16 * 2
+ src_len = (self.n_bits + 15) // 16 * 2
buf += type_desc.IntDescr(size=src_len).from_user(self.src)
# dst
if self._dst_type == 0: # match
diff --git a/ryu/ofproto/oxm_fields.py b/ryu/ofproto/oxm_fields.py
index c538f49..fbc96bf 100644
--- a/ryu/ofproto/oxm_fields.py
+++ b/ryu/ofproto/oxm_fields.py
@@ -290,7 +290,7 @@ def _parse_header_impl(mod, buf, offset):
exp_hdr_len = 0
value_len = oxm_length - exp_hdr_len
if oxm_hasmask:
- value_len /= 2
+ value_len //= 2
assert value_len > 0
field_len = hdr_len + oxm_length
total_hdr_len = hdr_len + exp_hdr_len
diff --git a/ryu/tests/unit/packet/test_icmpv6.py
b/ryu/tests/unit/packet/test_icmpv6.py
index d0523be..c2e7af1 100644
--- a/ryu/tests/unit/packet/test_icmpv6.py
+++ b/ryu/tests/unit/packet/test_icmpv6.py
@@ -412,7 +412,7 @@ class Test_icmpv6_neighbor_solicit(unittest.TestCase):
res = struct.unpack(icmpv6.nd_option_sla._PACK_STR, str(buf[24:]))
eq_(res[0], icmpv6.ND_OPTION_SLA)
- eq_(res[1], len(icmpv6.nd_option_sla()) / 8)
+ eq_(res[1], len(icmpv6.nd_option_sla()) // 8)
eq_(res[2], addrconv.mac.text_to_bin('00:00:00:00:00:00'))
def test_json(self):
@@ -535,7 +535,7 @@ class
Test_icmpv6_neighbor_advert(Test_icmpv6_neighbor_solicit):
res = struct.unpack(icmpv6.nd_option_tla._PACK_STR, str(buf[24:]))
eq_(res[0], icmpv6.ND_OPTION_TLA)
- eq_(res[1], len(icmpv6.nd_option_tla()) / 8)
+ eq_(res[1], len(icmpv6.nd_option_tla()) // 8)
eq_(res[2], addrconv.mac.text_to_bin('00:00:00:00:00:00'))
@@ -695,7 +695,7 @@ class Test_icmpv6_router_solicit(unittest.TestCase):
res = struct.unpack(icmpv6.nd_option_sla._PACK_STR, str(buf[8:]))
eq_(res[0], icmpv6.ND_OPTION_SLA)
- eq_(res[1], len(icmpv6.nd_option_sla()) / 8)
+ eq_(res[1], len(icmpv6.nd_option_sla()) // 8)
eq_(res[2], addrconv.mac.text_to_bin('00:00:00:00:00:00'))
def test_json(self):
@@ -760,7 +760,7 @@ class Test_icmpv6_router_advert(unittest.TestCase):
res = struct.unpack(icmpv6.nd_option_sla._PACK_STR, str(buf[16:]))
eq_(res[0], icmpv6.ND_OPTION_SLA)
- eq_(res[1], len(icmpv6.nd_option_sla()) / 8)
+ eq_(res[1], len(icmpv6.nd_option_sla()) // 8)
eq_(res[2], addrconv.mac.text_to_bin('00:00:00:00:00:00'))
# with nd_option_pi
@@ -821,13 +821,13 @@ class Test_icmpv6_router_advert(unittest.TestCase):
res = struct.unpack(icmpv6.nd_option_sla._PACK_STR, str(buf[16:24]))
eq_(res[0], icmpv6.ND_OPTION_SLA)
- eq_(res[1], len(icmpv6.nd_option_sla()) / 8)
+ eq_(res[1], len(icmpv6.nd_option_sla()) // 8)
eq_(res[2], addrconv.mac.text_to_bin('00:00:00:00:00:00'))
res = struct.unpack(icmpv6.nd_option_pi._PACK_STR, str(buf[24:]))
eq_(res[0], icmpv6.ND_OPTION_PI)
- eq_(res[1], len(icmpv6.nd_option_pi()) / 8)
+ eq_(res[1], len(icmpv6.nd_option_pi()) // 8)
eq_(res[2], 0)
eq_(res[3], 0)
eq_(res[4], 0)
@@ -859,7 +859,7 @@ class Test_icmpv6_nd_option_la(unittest.TestCase):
res = struct.unpack(icmpv6.nd_option_sla._PACK_STR, str(buf))
eq_(res[0], icmpv6.ND_OPTION_SLA)
- eq_(res[1], len(icmpv6.nd_option_sla()) / 8)
+ eq_(res[1], len(icmpv6.nd_option_sla()) // 8)
eq_(res[2], addrconv.mac.text_to_bin('00:00:00:00:00:00'))
# with nd_neighbor
@@ -884,7 +884,7 @@ class Test_icmpv6_nd_option_la(unittest.TestCase):
res = struct.unpack(icmpv6.nd_option_tla._PACK_STR, str(buf[24:]))
eq_(res[0], icmpv6.ND_OPTION_TLA)
- eq_(res[1], len(icmpv6.nd_option_tla()) / 8)
+ eq_(res[1], len(icmpv6.nd_option_tla()) // 8)
eq_(res[2], addrconv.mac.text_to_bin('00:00:00:00:00:00'))
# with nd_router_solicit
@@ -908,7 +908,7 @@ class Test_icmpv6_nd_option_la(unittest.TestCase):
res = struct.unpack(icmpv6.nd_option_sla._PACK_STR, str(buf[8:]))
eq_(res[0], icmpv6.ND_OPTION_SLA)
- eq_(res[1], len(icmpv6.nd_option_sla()) / 8)
+ eq_(res[1], len(icmpv6.nd_option_sla()) // 8)
eq_(res[2], addrconv.mac.text_to_bin('00:00:00:00:00:00'))
@@ -926,7 +926,7 @@ class Test_icmpv6_nd_option_pi(unittest.TestCase):
res = struct.unpack(icmpv6.nd_option_pi._PACK_STR, str(buf))
eq_(res[0], icmpv6.ND_OPTION_PI)
- eq_(res[1], len(icmpv6.nd_option_pi()) / 8)
+ eq_(res[1], len(icmpv6.nd_option_pi()) // 8)
eq_(res[2], 0)
eq_(res[3], 0)
eq_(res[4], 0)
@@ -1720,7 +1720,7 @@ class Test_mldv2_report_group(unittest.TestCase):
def setUp_with_aux(self):
self.aux = '\x01\x02\x03\x04\x05\x06\x07\x08'
- self.aux_len = len(self.aux) / 4
+ self.aux_len = len(self.aux) // 4
self.mld = icmpv6.mldv2_report_group(
self.type_, self.aux_len, self.num, self.address, self.srcs,
self.aux)
@@ -1733,7 +1733,7 @@ class Test_mldv2_report_group(unittest.TestCase):
self.srcs = ['fe80::1', 'fe80::2', 'fe80::3']
self.num = len(self.srcs)
self.aux = '\x01\x02\x03\x04\x05\x06\x07\x08'
- self.aux_len = len(self.aux) / 4
+ self.aux_len = len(self.aux) // 4
self.mld = icmpv6.mldv2_report_group(
self.type_, self.aux_len, self.num, self.address, self.srcs,
self.aux)
@@ -1928,7 +1928,7 @@ class Test_mldv2_report_group(unittest.TestCase):
@raises
def test_aux_len_larger_than_aux(self):
self.aux = '\x01\x02\x03\x04\x05\x06\x07\x08'
- self.aux_len = len(self.aux) / 4 + 1
+ self.aux_len = len(self.aux) // 4 + 1
self.buf = struct.pack(
icmpv6.mldv2_report_group._PACK_STR, self.type_, self.aux_len,
self.num, addrconv.ipv6.text_to_bin(self.address))
@@ -1941,7 +1941,7 @@ class Test_mldv2_report_group(unittest.TestCase):
@raises
def test_aux_len_smaller_than_aux(self):
self.aux = '\x01\x02\x03\x04\x05\x06\x07\x08'
- self.aux_len = len(self.aux) / 4 - 1
+ self.aux_len = len(self.aux) // 4 - 1
self.buf = struct.pack(
icmpv6.mldv2_report_group._PACK_STR, self.type_, self.aux_len,
self.num, addrconv.ipv6.text_to_bin(self.address))
--
2.3.2 (Apple Git-55)
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel