Skip to content

Commit

Permalink
CLI: set localhost as default for database hostname in verdi setup
Browse files Browse the repository at this point in the history
The default was actually being defined on the option, however, it was
taken from the `pgsu.DEFAULT_DSN` dictionary, which defines the database
hostname to be `None`. Still, 9 out of 10 times the database is on the
localhost so not having this as a default is kind of annoying and
unnecessary.
  • Loading branch information
sphuber committed May 4, 2021
1 parent 87ab7e3 commit 8ea1c8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aiida/cmdline/params/options/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def decorator(command):
'--db-host',
type=types.HostnameType(),
help='Database server host. Leave empty for "peer" authentication.',
default=DEFAULT_DBINFO['host']
default='localhost'
)

DB_PORT = OverridableOption(
Expand Down
2 changes: 1 addition & 1 deletion aiida/cmdline/params/options/commands/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def get_quicksetup_password(ctx, param, value): # pylint: disable=unused-argume

SETUP_DATABASE_HOSTNAME = QUICKSETUP_DATABASE_HOSTNAME.clone(
prompt='Database host',
contextual_default=functools.partial(get_profile_attribute_default, ('database_hostname', DEFAULT_DBINFO['host'])),
contextual_default=functools.partial(get_profile_attribute_default, ('database_hostname', 'localhost')),
cls=options.interactive.InteractiveOption
)

Expand Down

0 comments on commit 8ea1c8c

Please sign in to comment.