Dear everyone,

I'm currently trying to use Ryu to control our switches. I'm new to Ryu, 
so I might just be doing stuff wrong. Also, I couldn't find an 'Issues' 
tab on GitHub. Is this the correct place to report bugs?

Setup:
Downloaded Ryu from source `git clone git://github.com/osrg/ryu.git`
Installed Ryu `cd ryu; python ./setup.py install`
Run with `ryu-manager l2.py`

Ryu function:
OFPFlowMod._serialize_body() in /ryu/ryu/ofproto/ofproto_v1_3_parser.py

Trace:
hub: uncaught exception: Traceback (most recent call last):
   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 52, 
in _launch
     func(*args, **kwargs)
   File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", 
line 275, in _event_loop
     handler(ev)
   File "/home/karel/ryu/karel/l2.py", line 47, in 
port_desc_stats_reply_handler
     self.use_case_2(recieved_datapath)
   File "/home/karel/ryu/karel/l2.py", line 122, in use_case_2
     self.ofdpa_instance.create_flow_vlan(port_ids, vlan)
   File "/home/karel/ryu/karel/ofdpa.py", line 210, in create_flow_vlan
     test.convert(mod)
   File "/home/karel/ryu/karel/Ryu_to_REST.py", line 23, in convert
     print mod._serialize_body()
   File 
"/usr/local/lib/python2.7/dist-packages/ryu/ofproto/ofproto_v1_3_parser.py", 
line 2487, in _serialize_body
     self.out_group, self.flags)
   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/pack_utils.py", 
line 21, in msg_pack_into
     if len(buf) < offset:
TypeError: object of type 'NoneType' has no len()

Possible cause:
Function passes `self.buf` to `msg_pack_into`, but `self.buf` is never 
defined, thus resulting in a NoneType TypeError

Additional info:
Seems all _serialize_body() functions in ofproto_v1_3_parser.py work 
this way, and will give the same error.

Background:
I've written some examples for our switches in Ryu. An important part of 
our partners is working in OpenDaylight instead of Ryu, so I'd like to 
convert my examples to OpenDaylight. I figured the easiest way to do is 
convert the OFPFlowMod to a JSON that the OpenDaylight REST API can 
handle. It seems that the OFPFlowMod._serialize_body() is the native 
function to serialize the OFPFlowMod data, bringing it one step closer 
to OpenDaylight REST API compatibility.

Am I using this function correctly? If so, is this indeed a bug? Can 
someone fix it? Of course I can also give fixing it myself a shot if 
desired.

Thanks and kind regards,

Karel van de Plassche

------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to