New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle chars "$" and "\" in job output if formatter is used #124

Merged
merged 1 commit into from Oct 6, 2017

Conversation

Projects
None yet
2 participants
@afrimberger
Contributor

afrimberger commented Oct 6, 2017

If the output of a command contains the chars "$" or "" and the
formatter is used, the characters "$" and "" are not handled. Hence,
an exception is thrown:
java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:857)
at org.rundeck.client.util.Format.format(Format.java:44)

Steps to reproduce

  1. Create a job "mytestjob", which executes the inline script echo '$some-test$'
  2. Execute the job via cli command: rd run --outformat '%node: %log' --job 'mytestjob' --follow

Actual result (without this fix)

java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:857)
at org.rundeck.client.util.Format.format(Format.java:44)

Expected result

no exception, just the output:

$some-test$

Handle chars "$" and "\" in job output if formatter is used
If the output of a command contains the chars "$" or "\" and the
formatter is used, the characters "$" and "\" are not handled. Hence,
an exception is thrown:
java.lang.IllegalArgumentException: Illegal group reference
	at java.util.regex.Matcher.appendReplacement(Matcher.java:857)
	at org.rundeck.client.util.Format.format(Format.java:44)
@gschueler

This comment has been minimized.

Show comment
Hide comment
@gschueler

gschueler Oct 6, 2017

Member

thank you!

Member

gschueler commented Oct 6, 2017

thank you!

@gschueler gschueler merged commit 6b0e678 into rundeck:master Oct 6, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment