You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the following example where we try to retrieve a user API key:
$ java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080 groovy groovy.groovy
ERROR: This command is requesting the deprecated -remoting mode. See https://jenkins.io/redirect/cli-command-requires-channel
$ echo $?
5
On Jenkins versions > 2.46.2 the -remoting flag is needed to make this command work, but somehow the jenkins_user_api module doesn't report an error for the non-zero exit code, at least in this circumstance. There is code in jenkins_user_api to handle this case, but someone it's not working as expected.
The text was updated successfully, but these errors were encountered:
I believe I see what's going on here. While we are properly checking for the value of the exit code, we are not properly calling module.fail_json when the error occurs.
Also, I will note that the importance of this has already been worked around in cinch by checking for the need of the -remoting flag, but the module should still be fixed for future conditions that might arise.
The jenkins_user_api module was not properly capturing errors and
incorrect exit codes when the module was being executed improperly. Now,
more of those cases should be handled properly and trigger an error
state in Ansible.
Fixes: RedHatQE#151
Consider the following example where we try to retrieve a user API key:
On Jenkins versions > 2.46.2 the -remoting flag is needed to make this command work, but somehow the jenkins_user_api module doesn't report an error for the non-zero exit code, at least in this circumstance. There is code in jenkins_user_api to handle this case, but someone it's not working as expected.
The text was updated successfully, but these errors were encountered: