Friday 15 May 2015

erb - Arithmetic operations inside templates -



erb - Arithmetic operations inside templates -

i'm trying add together number parameter within puppet template below

"https://localhost:<%= 9443 + @offset %>/service/"

this gives me next error.

detail: string can't coerced fixnum

'offset' numeric value. possible kind of arithmetic operations in puppet?

everything in puppet parsed string. give next try:

"https://localhost:<%= 9443 + @offset.to_i %>/service/"

or

"https://localhost:<%= 9443 + integer(@offset) %>/service/"

hope helps.

erb puppet

No comments:

Post a Comment