This is not necessary because fact values are always strings, and it wasn't doing the unnecessary job it was expected to do anyway.
Signed-off-by: Nick Lewis <[email protected]> --- .../indirector/facts/inventory_active_record.rb | 3 --- lib/puppet/rails/inventory_fact.rb | 1 - .../facts/inventory_active_record_spec.rb | 6 ------ 3 files changed, 0 insertions(+), 10 deletions(-) diff --git a/lib/puppet/indirector/facts/inventory_active_record.rb b/lib/puppet/indirector/facts/inventory_active_record.rb index 2c2597f..89edaf3 100644 --- a/lib/puppet/indirector/facts/inventory_active_record.rb +++ b/lib/puppet/indirector/facts/inventory_active_record.rb @@ -8,9 +8,6 @@ class Puppet::Node::Facts::InventoryActiveRecord < Puppet::Indirector::ActiveRec return nil unless node facts = Puppet::Node::Facts.new(node.name, node.facts_to_hash) facts.timestamp = node.timestamp - facts.values.each do |key,value| - facts.values[key] = value.first if value.is_a?(Array) && value.length == 1 - end facts end diff --git a/lib/puppet/rails/inventory_fact.rb b/lib/puppet/rails/inventory_fact.rb index 0339433..aa6334e 100644 --- a/lib/puppet/rails/inventory_fact.rb +++ b/lib/puppet/rails/inventory_fact.rb @@ -2,5 +2,4 @@ require 'puppet/rails/inventory_node' class Puppet::Rails::InventoryFact < ::ActiveRecord::Base belongs_to :node, :class_name => "Puppet::Rails::InventoryNode" - serialize :value end diff --git a/spec/unit/indirector/facts/inventory_active_record_spec.rb b/spec/unit/indirector/facts/inventory_active_record_spec.rb index ca16606..c29e584 100644 --- a/spec/unit/indirector/facts/inventory_active_record_spec.rb +++ b/spec/unit/indirector/facts/inventory_active_record_spec.rb @@ -88,12 +88,6 @@ describe "Puppet::Node::Facts::InventoryActiveRecord", :if => (Puppet.features.r it "should return nil if no node instance can be found" do Puppet::Node::Facts.find("non-existent node").should == nil end - - it "should convert all single-member arrays into non-arrays" do - Puppet::Node::Facts.new("array", "fact1" => ["value1"]).save - - Puppet::Node::Facts.find("array").values["fact1"].should == "value1" - end end describe "#search" do -- 1.7.4.1 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
