Skip to content

Commit

Permalink
fix #13149 in is a keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Nov 16, 2016
1 parent 460abaf commit 43428e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/puppet_x/icinga2/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def self.attribute_types(attr)
def self.parse(row)
result = ''

if row =~ /^(.+)\s([\+-]|\*|\/|==|!=|&&|\|{2})\s(.+)$/
if row =~ /^(.+)\s([\+-]|\*|\/|==|!=|&&|\|{2}|in)\s(.+)$/
result += "%s %s %s" % [ parse($1), $2, parse($3) ]
else
if row =~ /^(.+)\((.*)\)$/
Expand Down
12 changes: 6 additions & 6 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
it { is_expected.to raise_error(Puppet::Error, /"foo" is not a Hash/) }
end

context "#{os} with constants => { foo => bar }" do
let(:params) { { :constants => {'foo' => 'bar'} } }
context "#{os} with constants => { foo => bar in foobar}" do
let(:params) { { :constants => {'foo' => 'bar in foobar'} } }

it { is_expected.to contain_file('/etc/icinga2/constants.conf')
.with_content(/^const foo = "bar"\n/) }
.with_content(/^const foo = "bar in foobar"\n/) }
end

context "#{os} with plugins => [ foo, bar ]" do
Expand Down Expand Up @@ -85,11 +85,11 @@
# .that_comes_before('Class[icinga2::config]') }
end

context 'windows with constants => { foo => bar }' do
let(:params) { { :constants => {'foo' => 'bar'} } }
context 'windows with constants => { foo => bar in foobar }' do
let(:params) { { :constants => {'foo' => 'bar in foobar'} } }

it { is_expected.to contain_file('C:/ProgramData/icinga2/etc/icinga2/constants.conf')
.with_content(/^const foo = "bar"\r\n/) }
.with_content(/^const foo = "bar in foobar"\r\n/) }
end

context 'windows with plugins => [ foo, bar ]' do
Expand Down
6 changes: 3 additions & 3 deletions spec/defines/object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@
end


context "#{os} with assign => [ host.vars.os == bar && host.address, NodeName != baz || !host.address]" do
let(:params) { {:assign => ['host.vars.os == bar && host.address', 'NodeName != baz'], :object_type => 'foo', :target => '/bar/baz', :order => '10'} }
context "#{os} with assign => [ host.vars.os == bar && host.address, generic-host in host.templates]" do
let(:params) { {:assign => ['host.vars.os == bar && host.address', 'generic-host in host.templates'], :object_type => 'foo', :target => '/bar/baz', :order => '10'} }

it { is_expected.to contain_concat__fragment('icinga2::object::foo::bar')
.with_content(/assign where host.vars.os == "bar" && host.address/)
.with_content(/assign where NodeName != "baz"/) }
.with_content(/assign where "generic-host" in host.templates/) }
end


Expand Down

0 comments on commit 43428e0

Please sign in to comment.