Skip to content
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
Merged

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

merged 1 commit into from
Oct 6, 2017

Conversation

afrimberger
Copy link
Contributor

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$

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
Copy link
Member

thank you!

@gschueler gschueler merged commit 6b0e678 into rundeck:master Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants