From 6b727c43b9c070595ca55b37cd9d61cac44e205f Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Fri, 25 Aug 2017 21:35:06 +0530 Subject: [PATCH] Define the utility path lable, and help message for the Greenplum database server, shown in the preferences dialog. Also, fixed the issue, when server type is not defined in the DEFAULT_BINARY_PATHS, in the configuration. --- web/pgadmin/browser/server_groups/servers/gpdb.py | 6 ++++++ web/pgadmin/browser/server_groups/servers/types.py | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/browser/server_groups/servers/gpdb.py b/web/pgadmin/browser/server_groups/servers/gpdb.py index 878063d2e..77e4982a0 100644 --- a/web/pgadmin/browser/server_groups/servers/gpdb.py +++ b/web/pgadmin/browser/server_groups/servers/gpdb.py @@ -12,6 +12,12 @@ from pgadmin.browser.server_groups.servers.types import ServerType class GPDB(ServerType): + UTILITY_PATH_LABEL = gettext("Greenplum Database Binary Path") + UTILITY_PATH_HELP = gettext( + "Path to the directory containing the Greenplum Database utility" + " programs (pg_dump, pg_restore etc)." + ) + def instanceOf(self, ver): return "Greenplum Database" in ver diff --git a/web/pgadmin/browser/server_groups/servers/types.py b/web/pgadmin/browser/server_groups/servers/types.py index b85fd3a39..29e72da6a 100644 --- a/web/pgadmin/browser/server_groups/servers/types.py +++ b/web/pgadmin/browser/server_groups/servers/types.py @@ -54,7 +54,10 @@ class ServerType(object): for key in cls.registry: st = cls.registry[key] - default_path = config.DEFAULT_BINARY_PATHS[st.stype] or "" + default_path = ( + config.DEFAULT_BINARY_PATHS[st.stype] if st.stype in + config.DEFAULT_BINARY_PATHS else "" + ) or "" st.utility_path = paths.register( 'bin_paths', st.stype + '_bin_dir',