Skip to content

Use __main__.py to enclose _backup.py etc.. #5147

@larkost

Description

@larkost

Our current way of running the administrative scripts such as export, restore, and index_rebuild is a bit awkward in that you call export backup and the server uses execvp to call rethinkdb-export. That is installed only when you have the driver installed on the system, so uses the first on on $PATH, and uses pkg_resources.load_entry_point to actually start the process from the module, again found via the $PATH. This all makes it hard to test, and a fragile if you are in the middle of transferring from one version of RethinkDB to another.

If instead we included a __main__.py file, and then drove all of the commands out of that one it would mean that the driver could be called directly, even if it was not on the path (e.g.: python -m /path/to/driver). That would change the call from the rethinkdb binary to be python -m rethinkdb export to match what we have now. And when combined with #4507 it would use the corresponding version of the driver.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions