Issue with spaces in string parameter

24 views
Skip to first unread message

Raunak Kumar Gupta

unread,
Nov 12, 2018, 2:56:01 AM11/12/18
to Jenkins Users
I have a string parameter in jenkins called 'Keywords'. I set the value of Keywords = "Google,Microsoft,Uber Go". But jenkins string parameter takes only till "Google,Microsoft,Uber" and truncates "Go" automatically.

Due to this my code runs incorrectly. Can anyone help in handling this auto-truncate issue in jenkins string parameter?

This string parameter is used in my python code where I split the Keywords on comma(,) and use the 3 generated words for operation in my code. But jenkins is truncating "Go" automatically due to which incorrect word is processed by my code

Danny Jacob

unread,
Nov 12, 2018, 8:15:55 AM11/12/18
to jenkins...@googlegroups.com
Uncheck ‘trim string’ checkbox in advanced and try. It should work

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0b6b1e2b-3af2-4aa0-a485-573d2c03ec3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Best Regards,
Jacob Dany
contact - +65 90224437

Martin d'Anjou

unread,
Nov 12, 2018, 6:23:02 PM11/12/18
to Jenkins Users
I doubt that would fix it, I was curious and try it. Jenkins trims, but it does not split the value on spaces.

The problem might be on how you pass the value to your python script. Can you share that?

Martin

Björn Pedersen

unread,
Nov 13, 2018, 7:34:26 AM11/13/18
to Jenkins Users


Am Dienstag, 13. November 2018 00:23:02 UTC+1 schrieb Martin d'Anjou:
I doubt that would fix it, I was curious and try it. Jenkins trims, but it does not split the value on spaces.

The problem might be on how you pass the value to your python script. Can you share that?


Just to show some problematic ways:

somescript $parms 
 -> here the shell (not jenkins or python) will split the arguments on spaces so you need to quote them
somescript "$params"
 -> now it is a single string, possibly with spaces

or use :

 os.environ.get['params'] inside your script to get the full string.

Björn
Reply all
Reply to author
Forward
0 new messages