backend: Move postgresql backend initialization in a separate class
Since commit swh-core@89d48572, the swh db init
command attempts
to instantiate the postgresql backend of a swh module using the get_datastore
function of the module with a cls
and db
parameters.
While it works fine for most of swh modules, it does not for the vault as more
parameters are expected by the get_vault
function and thus the database init
is failing. The issue was spotted in the docker environment after updating the
swh/stack
image.
So extract postgresql backend initialization for the vault in a new class named
VaultBackendDataStore
and set it as swh.vault.get_datastore
attribute value.
Related to swh-environment!274 (merged)
Edited by Antoine Lambert