Skip to content

Commit

Permalink
voxpupuli#193 changes to get rich rule working in 5.5, not expecting …
Browse files Browse the repository at this point in the history
…this to be merged
  • Loading branch information
bmagistro committed Nov 30, 2018
1 parent 135a0cf commit 839abb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/provider/firewalld_rich_rule/firewall_cmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def eval_action
return [] unless action = @resource[:action]
args=[]
if action.is_a?(Hash)
args << action[:action]
args << quote_keyval('type', action[:type])
args << action['action']
args << quote_keyval('type', action['type'])
else
args << action
end
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet_x/firewalld/property/rich_rule_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ def _validate_action(value)
end
validate do |value|
if value.is_a?(Hash)
if value.keys.sort != %i[action type]
if value.keys.sort != ["action", "type"]
raise Puppet::Error, "Rule action hash should contain `action` and `type` keys. Use a string if you only want to declare the action to be `accept` or `reject`. Got #{value}"
end
_validate_action(value[:action])
_validate_action(value["action"])
elsif value.is_a?(String)
_validate_action(value)
end
Expand Down

0 comments on commit 839abb5

Please sign in to comment.