ntt-sic / masakari

[UNMAINTAINED]
https://wiki.openstack.org/wiki/Masakari
Apache License 2.0
40 stars 24 forks source link

maskari-controller is not a python package #41

Open rsjethani opened 8 years ago

rsjethani commented 8 years ago

The character "-" in the name of a pyhon package is invalid. we get import error while creating database:

openstack@openstack_3:~/masakari/masakari-controller/db$ ./create_database.sh
/home/openstack/masakari/masakari-controller/db
/home/openstack/masakari
/usr/bin/python: No module named masakari-controller.db

Also masakari-controller does not contain init.py so as to be recognized as a package.

IMO directory structure should be like:

masakari-controller
`---controller
      `---__init__.py and other py files
masakari-instancemonitor
`---instance_monitor
     `---__init__.py and other py files

and so on.

sampathP commented 8 years ago

Thank you for the reporting the issues and sorry for the late response. As @rsjethani said, "-" should not use in pkg name tree. However, in current source tree masakari-controller does not consider as a package and that a one reason why I intentionally avoid init.py directly under masakari-controller directory. Furthermore, current source set masakari-controller as the parent dir by adding it to sys.path before import the sub modules. This was not the best solution but the affordable solution at the time.

Changing the top level directory structure will effect to most of the modules and pkging methods. Though, we have lot of changes coming in on next release, and changing the directory structure is among them.

Just for create db issue, PR #42 will fix the create database issue.

sampathP commented 8 years ago

@brocdeckard Thank you and please don't hesitate to raise issues if you have any problems or unclear points about masakari. I would be happy to help you out.