Hello, I like to use selectors like this in a few locations: $shell = $operatingsystem ? { ''freebsd'' => ''/usr/local/bin/bash'', default => ''/bin/bash'', } However it appears broken if I use an array value as my selection criteria: $info = [ "acrews", "Adam", "/bin/bash" ] $shell = $info[2] ? { /bin/ => $info[2], default => "/sbin/nologin", } I get: Syntax error at ''?''; expected ''} If I do this it works: $info = [ "acrews", "Adam", "/bin/bash" ] $AA = $info[2] $shell => $AA ? { /bin/ => $info[2], default => "/sbin/nologin", } This is just an example, I actually populate $info from an extlookup in a define that returns basically the same array. Am I doing something wrong, or is this a bug? Thanks -Adam -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 01/11/2011 10:48 PM, Adam Crews wrote:> $info = [ "acrews", "Adam", "/bin/bash" ] > $shell = $info[2] ? { > /bin/ => $info[2], > default => "/sbin/nologin", > } > > I get: Syntax error at ''?''; expected ''}> Am I doing something wrong, or is this a bug?To me, this looks like a bug. You should just report it, if it turns out to be a feature instead ;-) the devs will probably tell you so. Cheers, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Thu, Jan 13, 2011 at 5:04 AM, Felix Frank <felix.frank@alumni.tu-berlin.de> wrote:> On 01/11/2011 10:48 PM, Adam Crews wrote: >> $info = [ "acrews", "Adam", "/bin/bash" ] >> $shell = $info[2] ? { >> /bin/ => $info[2], >> default => "/sbin/nologin", >> } >> >> I get: Syntax error at ''?''; expected ''} > >> Am I doing something wrong, or is this a bug? > > To me, this looks like a bug. You should just report it, if it turns out > to be a feature instead ;-) the devs will probably tell you so. > > Cheers, > Felix >Thanks for the reply. I filed bug #5860 yesterday, and now that I search around a little more I think it may be the same as bug #5516. -Adam -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.