Hello,

While reading the Ryu book, I discovered that several applications in
ryu.app.* seem to be broken under Python 3:

test@host:~# ryu-manager --verbose ryu.app.rest_topology
loading app ryu.app.rest_topology
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/ryu/utils.py", line 81, in
import_module
    __import__(modname)
  File "/usr/local/lib/python3.4/dist-packages/ryu/app/rest_topology.py",
line 22, in <module>
    from ryu.topology.api import get_switch, get_link
  File "/usr/local/lib/python3.4/dist-packages/ryu/topology/api.py", line
38, in <module>
    app_manager.require_app('ryu.topology.switches', api_style=True)
  File "/usr/local/lib/python3.4/dist-packages/ryu/base/app_manager.py",
line 85, in require_app
    m._REQUIRED_APP = getattr(m, '_REQUIRED_APP', [])
AttributeError: 'NoneType' object has no attribute '_REQUIRED_APP'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/ryu-manager", line 9, in <module>
    load_entry_point('ryu==3.23.2', 'console_scripts', 'ryu-manager')()
  File "/usr/local/lib/python3.4/dist-packages/ryu/cmd/manager.py", line
88, in main
    app_mgr.load_apps(app_lists)
  File "/usr/local/lib/python3.4/dist-packages/ryu/base/app_manager.py",
line 389, in load_apps
    cls = self.load_app(app_cls_name)
  File "/usr/local/lib/python3.4/dist-packages/ryu/base/app_manager.py",
line 366, in load_app
    mod = utils.import_module(name)
  File "/usr/local/lib/python3.4/dist-packages/ryu/utils.py", line 92, in
import_module
    __import__(name)
  File "/usr/local/lib/python3.4/dist-packages/ryu/app/rest_topology.py",
line 22, in <module>
    from ryu.topology.api import get_switch, get_link
  File "/usr/local/lib/python3.4/dist-packages/ryu/topology/api.py", line
38, in <module>
    app_manager.require_app('ryu.topology.switches', api_style=True)
  File "/usr/local/lib/python3.4/dist-packages/ryu/base/app_manager.py",
line 85, in require_app
    m._REQUIRED_APP = getattr(m, '_REQUIRED_APP', [])
AttributeError: 'NoneType' object has no attribute '_REQUIRED_APP'

The above happens with Ryu 3.23.2 from PyPI on Python 3.4.0 (Ubuntu 14.04)

Additionally, I also saw the following error messages during install (Seems
like some files were missed during the 2->3 conversion):

Installing collected packages: ryu
  Running setup.py install for ryu
    [pbr] Reusing existing SOURCES.txt
    Installing ryu script to /usr/local/bin
    Installing ryu-manager script to /usr/local/bin
      File
"/usr/local/lib/python3.4/dist-packages/ryu/contrib/ovs/db/idl.py", line 189
        except error.Error, e:
                          ^
    SyntaxError: invalid syntax

      File
"/usr/local/lib/python3.4/dist-packages/ryu/contrib/ovs/stream.py", line 122
        def open_block((error, stream)):
                       ^
    SyntaxError: invalid syntax

      File
"/usr/local/lib/python3.4/dist-packages/ryu/contrib/ovs/fatal_signal.py",
line 93
        except OSError, e:
                      ^
    SyntaxError: invalid syntax

      File
"/usr/local/lib/python3.4/dist-packages/ryu/contrib/ovs/daemon.py", line 147
        except IOError, e:
                      ^
    SyntaxError: invalid syntax

      File
"/usr/local/lib/python3.4/dist-packages/ryu/contrib/ovs/poller.py", line 174
        except select.error, e:
                           ^
    SyntaxError: invalid syntax

      File
"/usr/local/lib/python3.4/dist-packages/ryu/contrib/ovs/socket_util.py",
line 40
        except socket.error, e:
                           ^
    SyntaxError: invalid syntax

      File
"/usr/local/lib/python3.4/dist-packages/ryu/contrib/ovs/json.py", line 146
        except UnicodeDecodeError, e:
                                 ^
    SyntaxError: invalid syntax

      File
"/usr/local/lib/python3.4/dist-packages/ryu/contrib/ovs/ovsuuid.py", line 45
        except error.Error, e:
                          ^
    SyntaxError: invalid syntax

Successfully installed ryu
Cleaning up...
test@host:~$

Note that other example applications such as simple_vlan and rest_qos are
affected by this, since they depend on the contrib.ovs modules.

Greetings from Germany,
-Fadi
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to