diff options
| author | Max Martin <max@puppetlabs.com> | 2011-03-17 13:42:46 -0700 |
|---|---|---|
| committer | Max Martin <max@puppetlabs.com> | 2011-03-17 13:42:46 -0700 |
| commit | 462a56060f0fffc7b8577f252000195e9384fb7a (patch) | |
| tree | c3447659483c2e286df255053655b00a46af4070 /lib/puppet/provider/exec/shell.rb | |
| parent | 17f673dd6fee08309970f8ff721855cf1644b45f (diff) | |
| parent | ec1aa192825f17afbe4dc12be1e0f2d644d74155 (diff) | |
Merge branch 'feature/2.6.next/4884-an-exec-provider-that-executes-unfiltered-bash-code' into 2.6.next
* feature/2.6.next/4884-an-exec-provider-that-executes-unfiltered-bash-code:
(#4884) Revise new exec tests, add a few more
(#4884) Add an shell provider for execs
(#4884) Fix Test::Unit exec tests
(#4884) Break the exec type out to have a posix provider
(#4884) Add consistent path validation and behavior
(#4884) Add expand_path to requiring the spec_helper
(#4884) Autorequire shared behaviors and method to silence warnings
(#4884) Fix whitespace
(#4884) Get rid of open3 require since it wasn't being used
Diffstat (limited to 'lib/puppet/provider/exec/shell.rb')
| -rw-r--r-- | lib/puppet/provider/exec/shell.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/puppet/provider/exec/shell.rb b/lib/puppet/provider/exec/shell.rb new file mode 100644 index 000000000..98f309e8f --- /dev/null +++ b/lib/puppet/provider/exec/shell.rb @@ -0,0 +1,17 @@ +Puppet::Type.type(:exec).provide :shell, :parent => :posix do + include Puppet::Util::Execution + + confine :feature => :posix + + desc "Execute external binaries directly, on POSIX systems. +passing through a shell so that shell built ins are available." + + def run(command, check = false) + command = %Q{/bin/sh -c "#{command.gsub(/"/,'\"')}"} + super(command, check) + end + + def validatecmd(command) + true + end +end |
