diff --git a/lib/puppet_x/icinga2/utils.rb b/lib/puppet_x/icinga2/utils.rb index c2082e0af..04f8df1e0 100644 --- a/lib/puppet_x/icinga2/utils.rb +++ b/lib/puppet_x/icinga2/utils.rb @@ -146,7 +146,10 @@ def self.process_hash(attrs, indent=2, level=3, prefix=' '*indent) else "%s%s = {\n%s%s}\n" % [ prefix, attribute_types(attr), process_hash(value, indent+2), ' ' * indent ] end elsif value.is_a?(Array) - result += "%s%s = [ %s]\n" % [ prefix, attribute_types(attr), process_array(value) ] + result += case level + when 2 then "%s[\"%s\"] = [ %s]\n" % [ prefix, attribute_types(attr), process_array(value) ] + else "%s%s = [ %s]\n" % [ prefix, attribute_types(attr), process_array(value) ] + end else if level > 1 if level == 3