diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2009-10-16 23:45:02 -0700 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-10-19 19:47:07 +1100 |
| commit | f59f8054dc0d1c86169b954fab96df650f38dd23 (patch) | |
| tree | a2de2de0a2c784b6b889b038724a9a05858ee1be /spec/unit/parser | |
| parent | 6ba122f62bf22c955a6923604a46a8ab22d8770b (diff) | |
Bug #1900 Parsing of quoted $ in stdin
When code comes in via STDIN or --code ,
Puppet::Util::Settings interpolates $values in the code,
which is probably never the intended behavior.
This is the least destructive fix I could think of:
have Puppet::Parser::Interpreter ask for the uninterpolated value.
More general fixes could be to:
a) Add an escape character to Settings's interpolator, and escape STDIN
b) Add a mechanism to Settings to mark some values as uninterpolated
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'spec/unit/parser')
| -rwxr-xr-x | spec/unit/parser/interpreter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/unit/parser/interpreter.rb b/spec/unit/parser/interpreter.rb index f06186a4e..182f3dab3 100755 --- a/spec/unit/parser/interpreter.rb +++ b/spec/unit/parser/interpreter.rb @@ -10,7 +10,7 @@ describe Puppet::Parser::Interpreter do describe "when creating parser instances" do it "should create a parser with code if there is code defined in the :code setting" do - Puppet.settings.stubs(:value).with(:code, :myenv).returns("mycode") + Puppet.settings.stubs(:uninterpolated_value).with(:code, :myenv).returns("mycode") @parser.expects(:string=).with("mycode") @parser.expects(:parse) Puppet::Parser::Parser.expects(:new).with(:environment => :myenv).returns(@parser) @@ -18,7 +18,7 @@ describe Puppet::Parser::Interpreter do end it "should create a parser with the main manifest when the code setting is an empty string" do - Puppet.settings.stubs(:value).with(:code, :myenv).returns("") + Puppet.settings.stubs(:uninterpolated_value).with(:code, :myenv).returns("") Puppet.settings.stubs(:value).with(:manifest, :myenv).returns("/my/file") @parser.expects(:parse) @parser.expects(:file=).with("/my/file") |
