Skip to content

Commit

Permalink
Ensure boolean properties munged
Browse files Browse the repository at this point in the history
The props hash is using symbol keys so the previous behavior was never actually munging and unmunging those boolean values

BEFORE:

ONBOOT=true

AFTER:

ONBOOT=yes
  • Loading branch information
treydock committed Oct 21, 2024
1 parent 3a1251c commit f96311a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/puppet/provider/network_config/redhat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def self.munge(pairs)
# For all of the remaining values, blindly toss them into the options hash.
props[:options] = pairs

%w[onboot hotplug].each do |bool_property|
%i[onboot hotplug].each do |bool_property|
props[bool_property] = (props[bool_property] == 'yes') if props[bool_property]
end

Expand Down Expand Up @@ -214,8 +214,8 @@ def self.format_file(filename, providers)
def self.unmunge(props)
pairs = {}

%w[onboot hotplug].each do |bool_property|
if props[bool_property]
%i[onboot hotplug].each do |bool_property|
unless props[bool_property].nil?
props[bool_property] = (props[bool_property] == true ? 'yes' : 'no')
end
end
Expand Down

0 comments on commit f96311a

Please sign in to comment.