[Ryu-devel] [PATCH 2/2] rest_router: Fix conversion of Packet Library to dict
On Python3, rest_router fails to compare the type of protocols in the Packet Library instances, because the non-parsed packet data is not str type but bytes type. This patch fixes to compare the protocols instance type with packet_base.PacketBase and enable to convert the Packet Library instances to dict. Signed-off-by: IWASE Yusuke--- ryu/app/rest_router.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ryu/app/rest_router.py b/ryu/app/rest_router.py index 2098ffa..81a3be4 100644 --- a/ryu/app/rest_router.py +++ b/ryu/app/rest_router.py @@ -40,6 +40,7 @@ from ryu.lib.packet import ethernet from ryu.lib.packet import icmp from ryu.lib.packet import ipv4 from ryu.lib.packet import packet +from ryu.lib.packet import packet_base from ryu.lib.packet import tcp from ryu.lib.packet import udp from ryu.lib.packet import vlan @@ -569,7 +570,8 @@ class Router(dict): # TODO: Packet library convert to string # self.logger.debug('Packet in = %s', str(pkt), self.sw_id) header_list = dict((p.protocol_name, p) - for p in pkt.protocols if type(p) != str) + for p in pkt.protocols + if isinstance(p, packet_base.PacketBase)) if header_list: # Check vlan-tag vlan_id = VLANID_NONE -- 2.7.4 -- Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot ___ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel
[Ryu-devel] [PATCH 1/2] dpset: Fix iteration error when disconnecting switches
When disconnecting switches, dpset will fail to unregister ports, because size of values in the port state dictionary might be changed when doing the iteration. This patch fixes to copy the values list and fixes this problem. Signed-off-by: IWASE Yusuke--- ryu/controller/dpset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ryu/controller/dpset.py b/ryu/controller/dpset.py index 5af6835..8004b2a 100644 --- a/ryu/controller/dpset.py +++ b/ryu/controller/dpset.py @@ -218,7 +218,7 @@ class DPSet(app_manager.RyuApp): # Now datapath is already dead, so port status change event doesn't # interfere us. ev = EventDP(dp, False) -for port in self.port_state.get(dp.id, {}).values(): +for port in list(self.port_state.get(dp.id, {}).values()): self._port_deleted(dp, port) ev.ports.append(port) -- 2.7.4 -- Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot ___ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel
Re: [Ryu-devel] OVSDB Manager Attribute error
Hi, Sorry, I don't know much about ryu/services/protocols/ovsdb, though... The error you got seems to be raised at the Python 'ovs' library, which is developed by the Open vSwitch project. https://github.com/openvswitch/ovs/tree/master/python How about taking contact to the Open vSwitch team? https://github.com/openvswitch/ovs#contact Thanks, Iwase On 2016年10月17日 13:50, srujana.banda...@wipro.com wrote: > Hi, > > We are trying to manage openVswitch using ryu controller using OVSDB manager. > But we are facing an Attribute error while doing the same. > > File "/root/venv/lib/python3.4/site-packages/ovs/db/idl.py", line 266, in > send_cond_change > if table.cond_changed: > AttributeError: 'TableSchema' object has no attribute 'cond_changed' > > Ryu application and the logs are attached. > > Please help us in understanding why the error is coming, though the schema is > received from the openVswitch. > > > Thanks and Regards, > Srujana. > > > The information contained in this electronic message and any attachments to > this message are intended for the exclusive use of the addressee(s) and may > contain proprietary, confidential or privileged information. If you are not > the intended recipient, you should not disseminate, distribute or copy this > e-mail. Please notify the sender immediately and destroy all copies of this > message and any attachments. WARNING: Computer viruses can be transmitted via > email. The recipient should check this email and any attachments for the > presence of viruses. The company accepts no liability for any damage caused > by any virus transmitted by this email. www.wipro.com > > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > > > ___ > Ryu-devel mailing list > Ryu-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/ryu-devel > -- Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot ___ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel