Issue #3731 has been updated by Thomas Bellman.

By "merge", I assume you mean "concatenate", right?  So if you do
<pre>
inst { foo: 
    config=>["set x 17", "set y 23"]
}
</pre>
it would be equivalent to doing
<pre>
augeas { "conf.d-memcache":
    context => "/files/etc/conf.d/memcached",
    changes => [
        "set MAXCONN 1000",
        "set LISTENON 127.0.0.1",
        "set x 17",
        "set y 23"
    ];
}
</pre>

I think the proper solution would be for the + operator in Puppet
to be able to operate on arrays as well, not just numbers like it
does now.  Then you could write your definition as
<pre>
define inst($config = []) {
    augeas { "conf.d-memcache":
        context => "/files/etc/conf.d/memcached",
        changes => [
            "set MAXCONN 1000",
            "set LISTENON 127.0.0.1",
           ] + $config,
    }
}
</pre>

----------------------------------------
Bug #3731: Cannot merge two arrays - Failed to retrieve current state of 
resource: undefined method `strip!' for #<Array:0x7f96f20436a8>"
http://projects.puppetlabs.com/issues/3731

Author: Doug Warner
Status: Unreviewed
Priority: Normal
Assigned to: 
Category: 
Target version: 
Affected version: 0.25.4
Keywords: 
Branch: 





-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to