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)
Merge request reports
Activity
mentioned in merge request swh-environment!274 (merged)
Jenkins job DVAU/gitlab-builds #44 succeeded .
See Console Output and Coverage Report for more details.For consistency with other modules, could you rename
VaultBackendDataStore
toVaultDb
?Eventually we should remove the inheritence from
VaultBackend, so it accesses it as
self.db` like other storage backends, too.Edited by vlorentzenabled an automatic merge when the pipeline for cac3766c succeeds
Jenkins job DVAU/gitlab-builds #45 succeeded .
See Console Output and Coverage Report for more details.