Len Rugen wrote:
Will something like this work in a template?
<% if fqdn.starts_with?'something' then %>
My test isn't working, I don't know if it's some minor syntax issue or
if I'm completely out of bounds.
--
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.
Looks like starts_with isn't a method:
irb(main):002:0> fqdn = "something.somesite.com"
=> "something.somesite.com"
irb(main):003:0> fqdn.starts_with?'some'
NoMethodError: undefined method `starts_with?' for
"something.somesite.com":String
If you don't have irb I suggest installing it, it's pretty useful for
testing this kind of stuff. I forget if there is a substring method like
starts_with, but you can do regex matching:
irb(main):004:0> if fqdn =~ /^some/
irb(main):005:1> puts "yea"
irb(main):006:1> end
yea
=> nil
--
Joe McDonagh
AIM: YoosingYoonickz
IRC: joe-mac on freenode
L'ennui est contre-révolutionnaire
--
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.