core.cli.db: Allow module_config_key to read db information from
We now have dotted modules whose section in the configuration file no longer match their
name. The db upgrade
cli had been evolved to deal with it but not the db init
cli.
This has been tested succesfully on the staging swh-blocking db [1]
[1] on a patched pod
swh@swh-toolbox-67b5bcb5d6-6wdpj:~$ swh db init storage.proxies.blocking --module-config-key=blocking_admin
WARNING:swh.core.sentry:Sentry DSN not provided, events will not be sent.
psql:/opt/swh/.local/lib/python3.10/site-packages/swh/core/db/sql/36-dbmodule.sql:12: NOTICE: relation "dbmodule" already exists, skipping
INFO:swh.core.cli.db:Initializing database version to 1 from the storage.proxies.blocking datastore
DONE database for storage.proxies.blocking initialized at version 1
swh@swh-toolbox-67b5bcb5d6-6wdpj:~$ bin/check-blocking-db-version.sh
WARNING:swh.core.sentry:Sentry DSN not provided, events will not be sent.
module: storage.proxies.blocking
current code version: 1
version: 1
Database already configured at the latest version.