From c792229c9a36c926cd58a16457bb5350a91b644f Mon Sep 17 00:00:00 2001 From: Leopold Talirz Date: Fri, 22 Sep 2017 09:01:36 +0200 Subject: [PATCH] verdi profile delete: fix dbport --- aiida/cmdline/commands/profile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aiida/cmdline/commands/profile.py b/aiida/cmdline/commands/profile.py index 1f25fbaba0..80897e1126 100644 --- a/aiida/cmdline/commands/profile.py +++ b/aiida/cmdline/commands/profile.py @@ -158,9 +158,6 @@ def profile_delete(self, *args): else: force = False - postgres = Postgres() - postgres.determine_setup() - confs = get_or_create_config() profiles = confs.get('profiles',{}) users = [ profiles[name].get('AIIDADB_USER', '') for name in profiles.keys()] @@ -173,6 +170,9 @@ def profile_delete(self, *args): print("Profile '{}' does not exist".format(profile_to_delete)) continue + postgres = Postgres(port=profile.get('AIIDADB_PORT')) + postgres.determine_setup() + db_name = profile.get('AIIDADB_NAME', '') if not postgres.db_exists(db_name): print("Associated database '{}' does not exist.".format(db_name))