#666 odcs oidc exchange prints to stdout, breaking jq
Closed: Fixed by lsedlar. Opened by ktdreyer.

If the odcs CLI client uses Kerberos authentication or it already has a cached OIDC token, then it prints nothing to STDOUT except some JSON that we can parse with jq.

If odcs has to perform the OIDC exchange (because the OIDC token is missing or expired), then it prints some help text with print(), like:

Attempting to launch a browser on your laptop. If it doesn't work, please go to https://auth.redhat.com/auth/realms/EmployeeIDP/protocol/openid-connect/auth?response_type=code&client_id=on-demand-compose-service&scope=openid+email&redirect_uri=... on your own

Unfortunately this breaks tools that expect odcs to only output JSON, like jq. For example, this fails:

odcs --redhat --quiet create-tag ceph-8.0-rhel-9-candidate --sigkey none | jq -r '.["result_repofile"]'

Could you please print all help text to STDERR instead? I think Python's logger will do this.


Commit e6d1c207 fixes this issue

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/pungi/odcs/issues/666

Please continue any further discussion there.

Metadata
Related Pull Requests