li...@truthisfreedom.org.uk wrote:

<% mysql_repl_dbs.split[','].each do | dbname | -%>
replicate-do-db=<%=dbname%>
<% end -%>

I get an error stating that puppet cannot convert a String to an Integer.

Function calls in Ruby use round parenthesis or none at
all, not square parenthesis.  Square parenthesis are used
for indexing.  Your code means: call the 'split' method on
mysql_repl_dbs with no parameters, and then index the
result with the string ','.  The split method will return
an array of strings (and since you didn't pass any parameters
to split, it will probably only be one element long, that
element being the original string you tried to split).  And
arrays can only be indexed by integers.

What you want is "mysql_repl_dbs.split(',').each() do".


        /Bellman

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to