-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
enhancementNew feature or requestNew feature or requestinitiative: Multiple Databases In One JobstoryTask for an EpicTask for an Epic
Milestone
Description
Overview
To support multiple databases of the same type, we should support subsections in the vdk configuration. The following config should be valid. VDK should parse three separate configs and name them using the subsection names.
[vdk]
oracle_connection_string = localhost:1521/FREE
[vdk.my_oracle]
oracle_connection_string = localhost:1521/FREE
[vdk.another_oracle]
oracle_connection_string = another.oracle.bg:1522/NOPSuggested Implementation
job_config.py
def get_vdk_options(self) -> Dict[Dict[str, str]]:
sections = self._config_ini.sections()
out = {}
for section in sections:
if "vdk" in section:
out[section] = dict(self._config_ini[section])
return out
def get_vdk_options_for_section(self, section: str = None) -> Dict[str, str]:
sections = self._config_ini.sections()
if section and self._config_ini.has_section(section):
return dict(self._config_ini[section])
elif self._config_ini.has_section("vdk"):
return dict(self._config_ini["vdk"])
else:
return {}And then in the JobConfigIniPlugin class
@hookimpl(tryfirst=True)
def vdk_configure(self, config_builder: ConfigurationBuilder) -> None:
for key, value in job_config.get_vdk_options_for_section("vdk").items():
config_builder.set_value(key, value)This should work for the current state of config files without any problem and support sections like vdk.something
Acceptance criteria
- Do the above implementation or a better alternative
- Add tests
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestinitiative: Multiple Databases In One JobstoryTask for an EpicTask for an Epic