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

Can't use 'rd run' with a job option starting with '@' #186

Closed
puremourning opened this issue Jun 28, 2018 · 5 comments
Closed

Can't use 'rd run' with a job option starting with '@' #186

puremourning opened this issue Jun 28, 2018 · 5 comments

Comments

@puremourning
Copy link

puremourning commented Jun 28, 2018

Describe the bug

rd run uses a special syntax for file attachments @something. This prevents using string options which start with @, like perforce labels.

My Rundeck detail

  • Rundeck version: 2.10.2
  • install type: rpm
  • OS Name/version: RedHat 6.5
  • DB Type/version: mysql
  • RD - Rundeck API Client Tool (v1.0.22) -

To Reproduce
Steps to reproduce the behavior:

  1. Create a job with a string option name Label
  2. Try and execute the job with rd run -p PROJECT -j JOB -- -Label @now
  3. See error

Expected behavior
The job option should be set to the value '@now'

Actual behaviour
rd run fails with:

Input error for [run]: File Option -Label: File cannot be read: now
You can use: "run help" to get help.

Additional context

Perforce labels are identified as @labelname, @now meaning the head revision.

Workaround

As mentioned on rundeck/rundeck#3590, the workaround is to export RD_URL=http://server:port/api/17. Confirmed this works.

@puremourning
Copy link
Author

puremourning commented Jun 29, 2018

Further, as mentioned here, the option doesn't enable debug mode when setting --logevel verbose

[edit] duh, this is posted on the wrong issue!

@gschueler
Copy link
Member

some ideas for fixing this:

  1. require a \ before the @ if it is the first char in the option value, e.g. -Label \@now
  2. add a flag to the run command to disable @value interpretation as files for all of the options (or inversely disable it by default and add a flag to enable it)
  3. remove -option @file processing, and require only -option@ file (which is already a feature)

@puremourning
Copy link
Author

puremourning commented Jun 29, 2018

personally i would go for 3., because it is the most canonical, but i realise that's a breaking change. I feel 2 is better than 1 because then you end up with 'what about an option that starts with a \@' and '\\@' etc. sort of fiddliness to implement.

I'm cool with any way to do it that works :)

@gschueler
Copy link
Member

Ok I think I will go with 2 (avoiding breakage)

gschueler added a commit that referenced this issue Jun 29, 2018
Fix #186 rd run --raw allows -opt @value literal
@puremourning
Copy link
Author

Thanks!

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

No branches or pull requests

2 participants