diff options
-rw-r--r-- | lib/chef/resource/windows_firewall_rule.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/resource/windows_firewall_rule.rb b/lib/chef/resource/windows_firewall_rule.rb index 70610b2889..3d961a6e82 100644 --- a/lib/chef/resource/windows_firewall_rule.rb +++ b/lib/chef/resource/windows_firewall_rule.rb @@ -76,7 +76,7 @@ class Chef description: "The profile the firewall rule applies to.", coerce: proc { |p| Array(p).map(&:downcase).map(&:to_sym).sort }, callbacks: { - "contains values not in :public, :private :domain, :any or :notapplicable" => lambda { |p| + "contains values not in :public, :private, :domain, :any or :notapplicable" => lambda { |p| p.all? { |e| %i{public private domain any notapplicable}.include?(e) } }, } @@ -110,6 +110,10 @@ class Chef else state = Chef::JSONCompat.from_json(output.stdout) end + + # Need to reverse `$rule.Profile.ToString()` in powershell command + current_profiles = state["profile"].split(", ").map(&:to_sym) + group state["group"] local_address state["local_address"] local_port Array(state["local_port"]).sort @@ -118,7 +122,7 @@ class Chef direction state["direction"] protocol state["protocol"] firewall_action state["firewall_action"] - profile state["profile"] + profile current_profiles program state["program"] service state["service"] interface_type state["interface_type"] |