diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-03-09 12:55:52 -0800 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-03-09 12:55:52 -0800 |
| commit | 531e25836e1313cd508ab8394e16cf438a62ac7b (patch) | |
| tree | ab39e3be5aee2005d599bd550e10fe0b2dcc3145 | |
| parent | 3489412a03fec009bc42222f449077e6f14998a4 (diff) | |
| download | puppet-531e25836e1313cd508ab8394e16cf438a62ac7b.tar.gz puppet-531e25836e1313cd508ab8394e16cf438a62ac7b.tar.xz puppet-531e25836e1313cd508ab8394e16cf438a62ac7b.zip | |
maint: Remove serialization of InventoryFact values
This is not necessary because fact values are always strings, and it wasn't
doing the unnecessary job it was expected to do anyway.
| -rw-r--r-- | lib/puppet/indirector/facts/inventory_active_record.rb | 3 | ||||
| -rw-r--r-- | lib/puppet/rails/inventory_fact.rb | 1 | ||||
| -rw-r--r-- | spec/unit/indirector/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 2c2597f81..89edaf332 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 033943358..aa6334eef 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 ca16606b2..c29e58400 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 |
