diff options
| author | Dominic Cleal <dcleal@redhat.com> | 2011-02-25 22:48:36 +0000 |
|---|---|---|
| committer | Dominic Cleal <dcleal@redhat.com> | 2011-02-25 23:26:59 +0000 |
| commit | f0d768465d011e01a4ce247130e3f139a23b4c54 (patch) | |
| tree | 3cbe3483a7dc07c0ddfc5fc470e53485ac29285d /lib/puppet/provider/augeas | |
| parent | 0026e43ef99f411ac66e76b88bae2bf3c0cc3734 (diff) | |
| download | puppet-f0d768465d011e01a4ce247130e3f139a23b4c54.tar.gz puppet-f0d768465d011e01a4ce247130e3f139a23b4c54.tar.xz puppet-f0d768465d011e01a4ce247130e3f139a23b4c54.zip | |
(#6494) Add setm command to Augeas provider
The Augeas setm command can set the value of multiple nodes in a single
operation. Takes a base path, then a subnode path expression (relative
to the base) and then the value itself.
Diffstat (limited to 'lib/puppet/provider/augeas')
| -rw-r--r-- | lib/puppet/provider/augeas/augeas.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb index 110885be8..5488c6674 100644 --- a/lib/puppet/provider/augeas/augeas.rb +++ b/lib/puppet/provider/augeas/augeas.rb @@ -32,6 +32,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do COMMANDS = { "set" => [ :path, :string ], + "setm" => [ :path, :string, :string ], "rm" => [ :path ], "clear" => [ :path ], "mv" => [ :path, :path ], @@ -338,6 +339,10 @@ Puppet::Type.type(:augeas).provide(:augeas) do debug("sending command '#{command}' with params #{cmd_array.inspect}") rv = aug.set(cmd_array[0], cmd_array[1]) fail("Error sending command '#{command}' with params #{cmd_array.inspect}") if (!rv) + when "setm" + debug("sending command '#{command}' with params #{cmd_array.inspect}") + rv = aug.setm(cmd_array[0], cmd_array[1], cmd_array[2]) + fail("Error sending command '#{command}' with params #{cmd_array.inspect}") if (rv == -1) when "rm", "remove" debug("sending command '#{command}' with params #{cmd_array.inspect}") rv = aug.rm(cmd_array[0]) |
