Skip to content

Commit 5c0a0f5

Browse files
xekopenshift-merge-bot[bot]
authored andcommitted
[federation] Replace jq with python3 in get-keycloak-token.sh
The openstackclient pod does not ship jq, causing the access_token and admin_token commands in get-keycloak-token.sh to fail with 'jq: command not found'. Replace both jq invocations with an equivalent python3 one-liner, which is always available in the openstackclient pod. Fixes: 8a15a5f Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com> Change-Id: Iaf5f4fa4607fe2eb9f255bed276e06b6df29d374 Signed-off-by: Grzegorz Grasza <xek@redhat.com>
1 parent 500aa49 commit 5c0a0f5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

roles/federation/templates/get-keycloak-token.sh.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ get_access_token() {
2828
-d "client_secret=${CLIENT_SECRET}" \
2929
-d "username=${username}" \
3030
-d "password=${password}" \
31-
-d "scope=openid profile email" | jq -r '.access_token // empty'
31+
-d "scope=openid profile email" | python3 -c "import sys, json; print(json.load(sys.stdin).get('access_token', ''))"
3232
}
3333

3434
get_auth_code() {
@@ -77,7 +77,7 @@ get_admin_token() {
7777
-d "grant_type=password" \
7878
-d "client_id=admin-cli" \
7979
-d "username={{ cifmw_federation_keycloak_admin_username }}" \
80-
-d "password={{ cifmw_federation_keycloak_admin_password }}" | jq -r '.access_token // empty'
80+
-d "password={{ cifmw_federation_keycloak_admin_password }}" | python3 -c "import sys, json; print(json.load(sys.stdin).get('access_token', ''))"
8181
}
8282

8383
case "$1" in

0 commit comments

Comments
 (0)