From bd8a79c974601db30ed5246483c7895b9cec2076 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 4 Aug 2026 17:14:01 +0300 Subject: [PATCH] Fix "'list object' has no attribute 'keys'" in deprecation checks The variables holding matched deprecated variable names used to be dictionaries (built via `vars | dict2items | ... | items2dict`), so calling `.keys()` on them was correct. Since a1f6ee4dc9b92fdb520627ec22265b800f73a6f8, they are lists produced by the `ansible.builtin.varnames` lookup, but 15 of the messages consuming them were left calling `.keys()`. The failing tasks are gated behind a `| length > 0` condition, so only people who actually still carry one of these deprecated variables would hit this. Such people were greeted by a cryptic templating error instead of the message telling them what to rename or remove. Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/5491 Co-Authored-By: Claude Opus 5 (1M context) --- .../tasks/validate_config.yml | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/roles/custom/matrix_playbook_migration/tasks/validate_config.yml b/roles/custom/matrix_playbook_migration/tasks/validate_config.yml index a1a3f792a..75fdbdf74 100644 --- a/roles/custom/matrix_playbook_migration/tasks/validate_config.yml +++ b/roles/custom/matrix_playbook_migration/tasks/validate_config.yml @@ -188,7 +188,7 @@ After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. - The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_vars | join(', ') }} when: "matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_vars | length > 0" - when: matrix_playbook_migration_matrix_backup_borg_migration_validation_enabled | bool @@ -207,7 +207,7 @@ After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. - The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_backup_borg_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_backup_borg_migration_vars | join(', ') }} when: "matrix_playbook_migration_backup_borg_migration_vars | length > 0" - when: matrix_playbook_migration_matrix_grafana_migration_validation_enabled | bool @@ -226,7 +226,7 @@ After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. - The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_grafana_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_grafana_migration_vars | join(', ') }} when: "matrix_playbook_migration_grafana_migration_vars | length > 0" - when: matrix_playbook_migration_matrix_ntfy_migration_validation_enabled | bool @@ -245,7 +245,7 @@ After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. - The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_ntfy_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_ntfy_migration_vars | join(', ') }} when: "matrix_playbook_migration_ntfy_migration_vars | length > 0" - when: matrix_playbook_migration_matrix_redis_migration_validation_enabled | bool @@ -264,7 +264,7 @@ After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. - The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_redis_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_redis_migration_vars | join(', ') }} when: "matrix_playbook_migration_redis_migration_vars | length > 0" - when: matrix_playbook_migration_redis_valkey_migration_validation_enabled | bool @@ -282,7 +282,7 @@ After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. - The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_redis_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_redis_migration_vars | join(', ') }} when: "matrix_playbook_migration_redis_migration_vars | length > 0" - when: matrix_playbook_migration_keydb_valkey_migration_validation_enabled | bool @@ -300,7 +300,7 @@ After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. - The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_keydb_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_keydb_migration_vars | join(', ') }} when: "matrix_playbook_migration_keydb_migration_vars | length > 0" - when: matrix_playbook_migration_matrix_etherpad_migration_validation_enabled | bool @@ -319,7 +319,7 @@ After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. - The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_etherpad_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_etherpad_migration_vars | join(', ') }} when: "matrix_playbook_migration_etherpad_migration_vars | length > 0" - when: matrix_playbook_migration_matrix_aux_migration_validation_enabled | bool @@ -338,7 +338,7 @@ After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. - The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_aux_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_aux_migration_vars | join(', ') }} when: "matrix_playbook_migration_aux_migration_vars | length > 0" - when: matrix_playbook_migration_matrix_jitsi_migration_validation_enabled | bool @@ -357,7 +357,7 @@ After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. - The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_jitsi_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_jitsi_migration_vars | join(', ') }} when: "matrix_playbook_migration_jitsi_migration_vars | length > 0" - when: matrix_playbook_migration_matrix_bridge_postmoogle_migration_validation_enabled | bool @@ -373,7 +373,7 @@ Please rename all variables (`matrix_bot_postmoogle_` -> `matrix_bridge_postmoogle_`) on your configuration file (vars.yml). - The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_postmoogle_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_postmoogle_migration_vars | join(', ') }} when: "matrix_playbook_migration_postmoogle_migration_vars | length > 0" - when: matrix_playbook_migration_matrix_nginx_proxy_elimination_variable_transition_checks_enabled | bool @@ -479,7 +479,7 @@ You should remove all its variables (`matrix_nginx_proxy_*`) from your configuration file (vars.yml). - The following variables in your configuration should be renamed: {{ matrix_playbook_migration_nginx_proxy_migration_vars.keys() | join(', ') }} + The following variables in your configuration should be renamed: {{ matrix_playbook_migration_nginx_proxy_migration_vars | join(', ') }} when: "matrix_playbook_migration_nginx_proxy_migration_vars | length > 0" - when: matrix_playbook_migration_matrix_ssl_leftover_variable_checks_enabled | bool @@ -495,7 +495,7 @@ You should remove all its variables (`matrix_ssl_*`) from your configuration file (vars.yml). - The following variables in your configuration should be renamed: {{ matrix_playbook_migration_ssl_migration_vars.keys() | join(', ') }} + The following variables in your configuration should be renamed: {{ matrix_playbook_migration_ssl_migration_vars | join(', ') }} when: "matrix_playbook_migration_ssl_migration_vars | length > 0" - block: @@ -506,7 +506,7 @@ - name: (Deprecation) Catch and report matrix_ssl variables ansible.builtin.fail: msg: >- - We found usage of the following variables which are now removed: {{ matrix_playbook_migration_matrix_synapse_container_labels_public_client_synapse_oidc_vars.keys() | join(', ') }} + We found usage of the following variables which are now removed: {{ matrix_playbook_migration_matrix_synapse_container_labels_public_client_synapse_oidc_vars | join(', ') }} when: "matrix_playbook_migration_matrix_synapse_container_labels_public_client_synapse_oidc_vars | length > 0" - block: @@ -517,7 +517,7 @@ - name: (Deprecation) Catch and report matrix_ssl variables ansible.builtin.fail: msg: >- - We found usage of the following variables which are now removed: {{ matrix_playbook_migration_matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_oidc_vars.keys() | join(', ') }} + We found usage of the following variables which are now removed: {{ matrix_playbook_migration_matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_oidc_vars | join(', ') }} when: "matrix_playbook_migration_matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_oidc_vars | length > 0" - name: (Deprecation) Catch and report devture_postgres_backup variables