Discussion:
Issue with spaces in string parameter
Raunak Kumar Gupta
2018-11-11 03:06:49 UTC
Permalink
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
--
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-users+***@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.
Danny Jacob
2018-11-12 11:22:29 UTC
Permalink
Uncheck ‘trim string’ checkbox in advanced and try. It should work
Post by Raunak Kumar Gupta
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
--
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
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*
--
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-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAD%2BZqMnKHt4_Kc%2BFd4t2Z%3DdceZxMFgCxs8%2BngA9V62BkitG_5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Martin d'Anjou
2018-11-12 23:23:01 UTC
Permalink
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
Post by Danny Jacob
Uncheck ‘trim string’ checkbox in advanced and try. It should work
Post by Raunak Kumar Gupta
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
--
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
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*
--
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-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/acbf5ab9-6595-4a5f-b058-d7b4c0240fbb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Björn Pedersen' via Jenkins Users
2018-11-13 12:34:26 UTC
Permalink
Post by 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
--
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-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1c510222-af7f-4955-a4ff-2b5fdc126f19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...