Open ramirezfranciscof opened 2 years ago
Indeed, the problem is that the Postgres
instance is not passed interactive=True
when verdi profile delete
is called from the command line.
One would need to give verdi profile delete
a --non-interactive
option and pass that through to the delete_profile
function.
Note: that would only solve the interactive case. If one wants the non-interactive case to work in general (when pgsu cannot automatically figure out how to log in as the postgres superuser), we will also need to add --su-db-username
and --su-db-password
options.
An alternative would be to store the su-db-username and su-db-password in AiiDA's config.json when running verdi quicksetup
and read it from there (if it exists) when deleting the profile but that doesn't sound like a good idea security-wise.
Todo:
--non-interactive
, --su-db-username
and --su-db-password
options to verdi profile delete
When access to postgres requires sudo privileges,
verdi quicksetup
will ask for the password butverdi profile delete
will not and fail instead. Not serious since if your setup remembers the sudo password (on by default, reference for controlling this) one can justsudo ls
and then run theverdi profile delete
command and it will work.