Skip to content

.empty? throwing exception on nil value #55

@samjaninf

Description

@samjaninf

In certain places in your files particularly in my case the host.pp and host/data.pp you have this:

'array' => inline_template("<%= (ips+[]).uniq.delete_if {|x| x.empty? }.join(',') %>"),

When I run that I get an error from puppet:

Error 400 on SERVER: Failed to parse inline template: undefined method `empty?‘ for :undef:Symbol

I believe it is because it is getting thrown a Nil value. I changed them to:

'array' => inline_template("<%= (ips+[]).uniq.delete_if {|x| x.nil? }.join(',') %>"),

and it seemed to work fine after that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions