diff --git a/cmk/gui/quick_setup/v0_unstable/predefined/_complete.py b/cmk/gui/quick_setup/v0_unstable/predefined/_complete.py index 1b3410df119..c5a56a779de 100644 --- a/cmk/gui/quick_setup/v0_unstable/predefined/_complete.py +++ b/cmk/gui/quick_setup/v0_unstable/predefined/_complete.py @@ -12,6 +12,7 @@ from cmk.utils.global_ident_type import GlobalIdent, PROGRAM_ID_QUICK_SETUP from cmk.utils.hostaddress import HostName +from cmk.utils.password_store import ad_hoc_password_id from cmk.utils.password_store import Password as StorePassword from cmk.utils.rulesets.definition import RuleGroup from cmk.utils.rulesets.ruleset_matcher import RuleConditionsSpec, RuleOptionsSpec, RuleSpec @@ -233,6 +234,19 @@ def _create_and_save_special_agent_bundle( site_selection = _find_unique_id(all_stages_form_data, "site_selection") site_id = SiteId(site_selection) if site_selection else omd_site() params = collect_params(all_stages_form_data, parameter_form) + + # TODO: Find a better solution. + # Here we replace the password id if the user has selected from password store + # otherwise, the previous one will be overwritten. + if all_stages_form_data[FormSpecId("credentials")]["secret_access_key"][1] == "stored_password": + all_stages_form_data[FormSpecId("credentials")]["secret_access_key"] = ( + "explicit_password", + all_stages_form_data[FormSpecId("credentials")]["secret_access_key"][1], + ( + ad_hoc_password_id(), + all_stages_form_data[FormSpecId("credentials")]["secret_access_key"][2][1], + ), + ) passwords = _collect_passwords_from_form_data(all_stages_form_data, parameter_form) # TODO: DCD still to be implemented cmk-18341