Compare commits

...

2 Commits

Author SHA1 Message Date
Brian Coca 5d8d47fd14 handle no galaxy 1 month ago
Brian Coca ea46dc8052 validate galaxy configs 1 month ago

@ -642,6 +642,7 @@ class ConfigCLI(CLI):
found = False found = False
config_entries = self._list_entries_from_args() config_entries = self._list_entries_from_args()
plugin_types = config_entries.pop('PLUGINS', None) plugin_types = config_entries.pop('PLUGINS', None)
galaxy_servers = config_entries.pop('GALAXY_SERVERS', None)
if context.CLIARGS['format'] == 'ini': if context.CLIARGS['format'] == 'ini':
if C.CONFIG_FILE is not None: if C.CONFIG_FILE is not None:
@ -658,6 +659,14 @@ class ConfigCLI(CLI):
sections[s].update(plugin_sections[s]) sections[s].update(plugin_sections[s])
else: else:
sections[s] = plugin_sections[s] sections[s] = plugin_sections[s]
if galaxy_servers:
for server in galaxy_servers:
server_sections = _get_ini_entries(galaxy_servers[server])
for s in server_sections:
if s in sections:
sections[s].update(server_sections[s])
else:
sections[s] = server_sections[s]
if sections: if sections:
p = C.config._parsers[C.CONFIG_FILE] p = C.config._parsers[C.CONFIG_FILE]
for s in p.sections(): for s in p.sections():

@ -347,15 +347,16 @@ class ConfigManager(object):
return config_def return config_def
for server_key in server_list: if server_list:
if not server_key: for server_key in server_list:
# To filter out empty strings or non truthy values as an empty server list env var is equal to ['']. if not server_key:
continue # To filter out empty strings or non truthy values as an empty server list env var is equal to [''].
continue
# Config definitions are looked up dynamically based on the C.GALAXY_SERVER_LIST entry. We look up the
# section [galaxy_server.<server>] for the values url, username, password, and token. # Config definitions are looked up dynamically based on the C.GALAXY_SERVER_LIST entry. We look up the
defs = dict((k, server_config_def(server_key, k, req, value_type)) for k, req, value_type in GALAXY_SERVER_DEF) # section [galaxy_server.<server>] for the values url, username, password, and token.
self.initialize_plugin_configuration_definitions('galaxy_server', server_key, defs) defs = dict((k, server_config_def(server_key, k, req, value_type)) for k, req, value_type in GALAXY_SERVER_DEF)
self.initialize_plugin_configuration_definitions('galaxy_server', server_key, defs)
def template_default(self, value, variables): def template_default(self, value, variables):
if isinstance(value, string_types) and (value.startswith('{{') and value.endswith('}}')) and variables is not None: if isinstance(value, string_types) and (value.startswith('{{') and value.endswith('}}')) and variables is not None:

Loading…
Cancel
Save