Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding rule property to crm location #310

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix Rubocop offenses again
smoeding committed Sep 5, 2016
commit 6511c4cb720fbac152b39825593846a83752390f
2 changes: 1 addition & 1 deletion lib/puppet/provider/cs_location/pcs.rb
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ def flush
name = rule_item.keys.first
rule = rule_item[name]

score = (rule['score-attribute'].nil?) ? "score=#{rule['score']}" : "score-attribute=\"#{rule['score-attribute']}\""
score = rule['score-attribute'].nil? ? "score=#{rule['score']}" : "score-attribute=\"#{rule['score-attribute']}\""

boolean_op = rule['boolean-op'] || 'and'
expression = self.class.rule_expression(name, rule['expression'], boolean_op)
16 changes: 12 additions & 4 deletions spec/acceptance/cs_location_spec.rb
Original file line number Diff line number Diff line change
@@ -137,10 +137,18 @@ class { 'corosync':
apply_manifest(pp, debug: true, catch_changes: true)
shell('cibadmin --query --xpath "//rule[@id=\'duncan_vip_not_in_container-rule\']"') do |r|
# attribute order in XML might be non-deterministic
it { expect(r.stdout).to match(%r{<rule .*score="-INFINITY"}) }
it { expect(r.stdout).to match(%r{<expression .*attribute="#kind"}) }
it { expect(r.stdout).to match(%r{<expression .*operation="eq"}) }
it { expect(r.stdout).to match(%r{<expression .*value="container"}) }
it 'contains the score attribute' do
expect(r.stdout).to match(%r{<rule .*score="-INFINITY"})
end
it 'contains the attribute attribute' do
expect(r.stdout).to match(%r{<expression .*attribute="#kind"})
end
it 'contains the operation atribute' do
expect(r.stdout).to match(%r{<expression .*operation="eq"})
end
it 'contains the value attribute' do
expect(r.stdout).to match(%r{<expression .*value="container"})
end
end
end
end