fix the following crash.
from Yuichi Ito. minor editorialization by me.
> Traceback (most recent call last):
> File "/usr/local/bin/ryu-manager", line 9, in <module>
> load_entry_point('ryu==3.6', 'console_scripts', 'ryu-manager')()
> File "/usr/local/lib/python2.7/dist-packages/ryu/cmd/manager.py", line 73,
> in main
> services.extend(app_mgr.instantiate_apps(**contexts))
> File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line
> 368, in instantiate_apps
> self._instantiate(app_name, cls, *args, **kwargs)
> > File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py",
> line 350, in _instantiate
> ofproto_protocol.set_app_supported_versions(cls.OFP_VERSIONS)
> File
> "/usr/local/lib/python2.7/dist-packages/ryu/ofproto/ofproto_protocol.py",
> line 40, in set_app_supported_versions
> _versions &= set(vers)
> UnboundLocalError: local variable '_versions' referenced before assignment
Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
ryu/ofproto/ofproto_protocol.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ryu/ofproto/ofproto_protocol.py b/ryu/ofproto/ofproto_protocol.py
index cf0495d..d9ca997 100644
--- a/ryu/ofproto/ofproto_protocol.py
+++ b/ryu/ofproto/ofproto_protocol.py
@@ -37,8 +37,10 @@ _supported_versions = set(_versions.keys())
def set_app_supported_versions(vers):
- _versions &= set(vers)
- assert _versions, 'No OpenFlow version is available'
+ global _supported_versions
+
+ _supported_versions &= set(vers)
+ assert _supported_versions, 'No OpenFlow version is available'
class ProtocolDesc(object):
--
1.8.3.1
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel