On Tue, Sep 14, 2010 at 12:12 PM, Douglas Garstang <doug.garst...@gmail.com> wrote: > If I have... > > $version_core = "t.1538-1" > $is_trunk_release = regsubst($version_core, '^(.*?)\.(.*?)$', '\1') > if $is_trunk_release == "t" { > notice ("here 1") > if $t >= 1583 { > notice ("here 2") > } > } > > Puppet complains with: > comparison of String with 1583 failed at > /etc/puppet/modules/elements/manifests/init.pp:220 on node > app09.fr.xxx.com > > However, the documentation says you can do: > > if $ram > 1024 { > $maxclient = 500 > }
You can. > > So, therefore .... how can I convert $is_trunk_release to an integer > so I can do a numerical comparison against it? Where are you defining $t ? I don't see it there. $version_core = "t.1538-1" $is_trunk_release = regsubst($version_core, '^(.*?)\.(.*?)$', '\1') if $is_trunk_release == "t" { notice ("here 1") notice("t is [$t]") # <------------------------- if $t >= 1583 { notice ("here 2") } } nigelk$ puppet --factpath /tmp/foo /tmp/test.pp notice: Scope(Class[main]): here 1 notice: Scope(Class[main]): t is [] comparison of String with 1583 failed at /tmp/test.pp:7 on node dhcp-172-19-29-14.mtv.corp.google.com -- 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.