This is an automated email from the ASF dual-hosted git repository.

vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 1bc86b2f79f Make Keycloak permission creation quietly idempotent like 
its sibling helpers (#71505)
1bc86b2f79f is described below

commit 1bc86b2f79fc34d5996fdd69ca7a04f78b75ea11
Author: Mathieu Monet <[email protected]>
AuthorDate: Wed Aug 12 17:57:46 2026 +0200

    Make Keycloak permission creation quietly idempotent like its sibling 
helpers (#71505)
    
    _create_scope_based_permission printed 'Policy creation skipped ... already
    exists' for every permission that create-team re-ensures after create-all,
    cluttering the output of a documented, idempotent sequence. Worse, any
    KeycloakError other than the name conflict was silently swallowed.
    
    Align it with the three sibling helpers in the same module (group, role and
    aggregate policy creation), which already treat a 'Conflicting policy' 
answer
    as a silent no-op and re-raise everything else.
---
 .../src/airflow/providers/keycloak/auth_manager/cli/commands.py      | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/providers/keycloak/src/airflow/providers/keycloak/auth_manager/cli/commands.py
 
b/providers/keycloak/src/airflow/providers/keycloak/auth_manager/cli/commands.py
index adb9aac6ff8..97d031427b3 100644
--- 
a/providers/keycloak/src/airflow/providers/keycloak/auth_manager/cli/commands.py
+++ 
b/providers/keycloak/src/airflow/providers/keycloak/auth_manager/cli/commands.py
@@ -622,8 +622,9 @@ def _create_scope_based_permission(
     except KeycloakError as e:
         if e.response_body:
             error = json.loads(e.response_body.decode("utf-8"))
-            if error.get("error_description") == "Conflicting policy":
-                print(f"Policy creation skipped. {error.get('error')}")
+            if "Conflicting policy" in error.get("error_description", ""):
+                return
+        raise
 
 
 def _create_resource_based_permission(

Reply via email to