On Thu, Oct 13, 2011 at 11:41 AM, midair77 <midai...@gmail.com> wrote:
> Thank you very much..  I am writing a function to do that.
>
>
> On Oct 13, 10:51 am, Jacob Helwig <ja...@puppetlabs.com> wrote:
>> On Thu, 13 Oct 2011 10:01:49 -0700, midair77 wrote:
>>
>> > Dear all,
>>
>> > I have a parameterized class and one of the args is a hash or an array
>> > and I would like to check if they are empty or not?
>>
>> > I tried with
>>
>> > class test($hash, $array){
>> >    if $hash.empty? == true
>> > {
>> > }
>> >   if $array.empty? == true
>> > {
>> > }
>>
>> > }
>>
>> > but when I just
>> > puppet parser validate init.pp
>>
>> > I would get this error: Could not parse for environment production:
>> > Syntax error at '.'; expected '}' at.
>>
>> > Please help as this is important to know how to do this type of check.
>>
>> > Thank you in advance.

See empty function:
https://github.com/puppetlabs/puppetlabs-stdlib/tree/master/lib/puppet/parser/functions

Thanks,

Nan

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to