Uploaded image for project: 'Zapped: AcousticBrainz'
  1. Zapped: AcousticBrainz
  2. AB-333

Use `FlaskGroup` for creating CLI interface in `dump_manage.py`

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • Server
    • None

      SInce `create_app` calls were removed from `dump_manage.py`, commands present there fail. For instance,

      ./develop.sh run --rm webserver python2 manage.py dump full_db
      

      (command for exporting data) fails with the error:

       

      Starting acousticbrainzserver_redis_1 ... done
      Creating full database dump...
      Traceback (most recent call last):
       File "manage.py", line 157, in <module>
       cli()
       File "/usr/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
       return self.main(*args, **kwargs)
       File "/usr/local/lib/python2.7/site-packages/flask/cli.py", line 380, in main
       return AppGroup.main(self, *args, **kwargs)
       File "/usr/local/lib/python2.7/site-packages/click/core.py", line 696, in main
       rv = self.invoke(ctx)
       File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
       return _process_result(sub_ctx.command.invoke(sub_ctx))
       File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
       return _process_result(sub_ctx.command.invoke(sub_ctx))
       File "/usr/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
       return ctx.invoke(self.callback, **ctx.params)
       File "/usr/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
       return callback(*args, **kwargs)
       File "/code/db/dump_manage.py", line 46, in full_db
       path = dump.dump_db(location, threads)
       File "/code/db/dump.py", line 143, in dump_db
       _copy_tables(archive_tables_dir, start_t, end_t)
       File "/code/db/dump.py", line 175, in _copy_tables
       connection = db.engine.raw_connection()
      AttributeError: 'NoneType' object has no attribute 'raw_connection'
      

            ferbncode Suyash Garg
            ferbncode Suyash Garg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package