diff --git a/lib/puppet/provider/network_config/interfaces.rb b/lib/puppet/provider/network_config/interfaces.rb index 604398a4..480f9348 100644 --- a/lib/puppet/provider/network_config/interfaces.rb +++ b/lib/puppet/provider/network_config/interfaces.rb @@ -100,7 +100,7 @@ def self.parse_file(filename, contents) interfaces.delete_at(0) interfaces.each do |iface| - iface_hash[iface][:hotplug] = true + iface_hash[iface][:hotplug] = :true end # Don't reset Reset the current parse state diff --git a/lib/puppet/provider/network_config/redhat.rb b/lib/puppet/provider/network_config/redhat.rb index aace5f12..286fff3c 100644 --- a/lib/puppet/provider/network_config/redhat.rb +++ b/lib/puppet/provider/network_config/redhat.rb @@ -126,7 +126,7 @@ def self.munge(pairs) [:onboot, :hotplug].each do |bool_property| if props[bool_property] - props[bool_property] = (props[bool_property] == 'yes') + props[bool_property] = (props[bool_property] == 'yes' ? :true : :false) end end @@ -171,7 +171,7 @@ def self.unmunge(props) [:onboot, :hotplug].each do |bool_property| if props[bool_property] - props[bool_property] = (props[bool_property] ? 'yes' : 'no') + props[bool_property] = (props[bool_property] == :true ? 'yes' : 'no') end end diff --git a/spec/unit/provider/network_config/interfaces_spec.rb b/spec/unit/provider/network_config/interfaces_spec.rb index 08fc6dfa..7d1708fa 100644 --- a/spec/unit/provider/network_config/interfaces_spec.rb +++ b/spec/unit/provider/network_config/interfaces_spec.rb @@ -41,7 +41,7 @@ def fixture_data(file) :family => "inet", :method => "dhcp", :name => "eth0", - :hotplug => true, + :hotplug => :true, :options => {}, } end diff --git a/spec/unit/provider/network_config/redhat_spec.rb b/spec/unit/provider/network_config/redhat_spec.rb index ed185032..6006a64d 100644 --- a/spec/unit/provider/network_config/redhat_spec.rb +++ b/spec/unit/provider/network_config/redhat_spec.rb @@ -43,12 +43,12 @@ def fixture_data(file) describe 'the hotplug property' do describe 'when true' do let(:data) { described_class.parse_file('eth0', fixture_data('eth0-hotplug'))[0] } - it { data[:hotplug].should be_true } + it { data[:hotplug].should == :true } end describe 'when false' do let(:data) { described_class.parse_file('eth0', fixture_data('eth0-nohotplug'))[0] } - it { data[:hotplug].should be_false } + it { data[:hotplug].should == :false } end end