Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to use MySQL #93

Open
SatoshiMD opened this issue Oct 21, 2020 · 1 comment
Open

Not able to use MySQL #93

SatoshiMD opened this issue Oct 21, 2020 · 1 comment

Comments

@SatoshiMD
Copy link

When I override DB setting, I got error. See below

settings.py
DATABASE_CLASS = 'ndscheduler.core.datastore.providers.mysql.DatastoreMySQL' DATABASE_CONFIG_DICT = { 'user': 'username', 'password': '', 'hostname': 'localhost', 'port': 3306, 'database': 'scheduler' }

Error
app_1 | Traceback (most recent call last): app_1 | File "scheduler.py", line 46, in <module> app_1 | SampleJobServer.run() app_1 | File "/usr/local/lib/python3.6/site-packages/ndscheduler/server/server.py", line 83, in run app_1 | cls.singleton = cls(scheduler_manager.SchedulerManager.get_instance()) app_1 | File "/usr/local/lib/python3.6/site-packages/ndscheduler/core/scheduler_manager.py", line 22, in get_instance app_1 | cls.instance = cls() app_1 | File "/usr/local/lib/python3.6/site-packages/ndscheduler/core/scheduler_manager.py", line 27, in __init__ app_1 | 'default': utils.get_datastore_instance() app_1 | File "/usr/local/lib/python3.6/site-packages/ndscheduler/utils.py", line 106, in get_datastore_instance app_1 | database_class = import_from_path(settings.DATABASE_CLASS) app_1 | File "/usr/local/lib/python3.6/site-packages/ndscheduler/utils.py", line 31, in import_from_path app_1 | return getattr(module, components[-1]) app_1 | AttributeError: module 'ndscheduler.core.datastore.providers.mysql' has no attribute 'DatastoreMySQL'

@robnardo
Copy link

I was also having this issue. I found that the reference to DATABASE_CLASS should be the following (notice the case of the class name). DatastoreMySQL should be DatastoreMysql

ndscheduler.core.datastore.providers.mysql.DatastoreMysql

I found the answer by trying to import the module and seeing what VS Code intellisense came up with. Not sure why I need to do this? I am using the version from PyPi which is 0.3.0 - is this not the latest version?

Update: Looks like file was deleted then added again with a different case for MySQL. This is the committ..

06b4a92 (search the page for "mysql")

Is there a pipeline to get latest version of Ndscheduler to PyPi.org ?

Hope this helps
:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants