Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce verdi quicksetup --non-interactive #4573

Merged
merged 2 commits into from
Nov 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions aiida/manage/external/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def check_dbuser(self, dbuser):
:param str dbuser: Name of the user to be created or reused.
:returns: tuple (dbuser, created)
"""
if not self.interactive:
return dbuser, not self.dbuser_exists(dbuser)
create = True
while create and self.dbuser_exists(dbuser):
echo.echo_info(f'Database user "{dbuser}" already exists!')
Expand Down Expand Up @@ -163,6 +165,8 @@ def check_db(self, dbname):
:param str dbname: Name of the database to be created or reused.
:returns: tuple (dbname, created)
"""
if not self.interactive:
return dbname, not self.db_exists(dbuser)
chrisjsewell marked this conversation as resolved.
Show resolved Hide resolved
create = True
while create and self.db_exists(dbname):
echo.echo_info(f'database {dbname} already exists!')
Expand Down