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.
This commit is contained in:
Ashesh Vashi 2017-08-25 21:35:06 +05:30
parent 74db837417
commit 6b727c43b9
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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',