diff options
-rw-r--r-- | lib/puppet/interface/action.rb | 2 | ||||
-rwxr-xr-x | spec/unit/interface/action_spec.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/puppet/interface/action.rb b/lib/puppet/interface/action.rb index bd47a36ea..60ddb2ca3 100644 --- a/lib/puppet/interface/action.rb +++ b/lib/puppet/interface/action.rb @@ -269,6 +269,8 @@ WRAPPER else result[canonical] = original[name] end + elsif Puppet.settings.include? name + result[name] = original[name] else unknown << name end diff --git a/spec/unit/interface/action_spec.rb b/spec/unit/interface/action_spec.rb index c3f08e817..6b68eb149 100755 --- a/spec/unit/interface/action_spec.rb +++ b/spec/unit/interface/action_spec.rb @@ -552,7 +552,7 @@ describe Puppet::Interface::Action do context "#validate_and_clean" do subject do Puppet::Interface.new(:validate_args, '1.0.0') do - script :test do |options| true end + script :test do |options| options end end end @@ -576,6 +576,12 @@ describe Puppet::Interface::Action do expect { subject.test :unknown => true, :unseen => false }. to raise_error ArgumentError, /Unknown options passed: unknown, unseen/ end + + it "should accept 'global' options from settings" do + expect { + subject.test(:certname => "true").should == { :certname => "true" } + }.not_to raise_error + end end context "default option values" do |