summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2016-05-10 14:29:38 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-05-13 22:24:53 +0900
commit326b46bf6d72e201fa8667f757ac5d2cef18885a (patch)
treec036b817933fa5b91881f3ef534549719bd2f8e2
parent4b9957924920eb533de46d00ae662b872ee50a3e (diff)
topology: Adopt to Python 3
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/topology/switches.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ryu/topology/switches.py b/ryu/topology/switches.py
index d429effd..971d30bf 100644
--- a/ryu/topology/switches.py
+++ b/ryu/topology/switches.py
@@ -87,7 +87,7 @@ class Port(object):
return {'dpid': dpid_to_str(self.dpid),
'port_no': port_no_to_str(self.port_no),
'hw_addr': self.hw_addr,
- 'name': self.name.rstrip('\0')}
+ 'name': self.name.decode('utf-8')}
# for Switch.del_port()
def __eq__(self, other):
@@ -476,7 +476,7 @@ class LLDPPacket(object):
if tlv_chassis_id.subtype != lldp.ChassisID.SUB_LOCALLY_ASSIGNED:
raise LLDPPacket.LLDPUnknownFormat(
msg='unknown chassis id subtype %d' % tlv_chassis_id.subtype)
- chassis_id = tlv_chassis_id.chassis_id
+ chassis_id = tlv_chassis_id.chassis_id.decode('utf-8')
if not chassis_id.startswith(LLDPPacket.CHASSIS_ID_PREFIX):
raise LLDPPacket.LLDPUnknownFormat(
msg='unknown chassis id format %s' % chassis_id)