mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-10 14:56:11 +02:00
python3: Modify a literal argument in a bytes method call to bytes type
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
815dc505b7
commit
4099aec69a
@ -333,7 +333,7 @@ class OFPPort(ofproto_parser.namedtuple('OFPPort', (
|
||||
i = cls._fields.index('hw_addr')
|
||||
port[i] = addrconv.mac.bin_to_text(port[i])
|
||||
i = cls._fields.index('name')
|
||||
port[i] = port[i].rstrip('\0')
|
||||
port[i] = port[i].rstrip(b'\0')
|
||||
return cls(*port)
|
||||
|
||||
|
||||
@ -1985,7 +1985,7 @@ class OFPDescStats(ofproto_parser.namedtuple('OFPDescStats', (
|
||||
desc = struct.unpack_from(ofproto.OFP_DESC_STATS_PACK_STR,
|
||||
buf, offset)
|
||||
desc = list(desc)
|
||||
desc = [x.rstrip('\0') for x in desc]
|
||||
desc = [x.rstrip(b'\0') for x in desc]
|
||||
stats = cls(*desc)
|
||||
stats.length = ofproto.OFP_DESC_STATS_SIZE
|
||||
return stats
|
||||
@ -2375,7 +2375,7 @@ class OFPTableStats(
|
||||
buf, offset)
|
||||
table = list(table)
|
||||
i = cls._fields.index('name')
|
||||
table[i] = table[i].rstrip('\0')
|
||||
table[i] = table[i].rstrip(b'\0')
|
||||
stats = cls(*table)
|
||||
stats.length = ofproto.OFP_TABLE_STATS_SIZE
|
||||
return stats
|
||||
|
||||
@ -4985,7 +4985,7 @@ class TestOFPTableStats(unittest.TestCase):
|
||||
res = OFPTableStats.parser(buf, 0)
|
||||
|
||||
eq_(table_id, res.table_id)
|
||||
eq_(name, res.name.replace(b'\x00', ''))
|
||||
eq_(name, res.name.replace(b'\x00', b''))
|
||||
eq_(match, res.match)
|
||||
eq_(wildcards, res.wildcards)
|
||||
eq_(write_actions, res.write_actions)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user