[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.5-303-gfcfa26a

Nick Lewis nick at puppetlabs.com
Thu Mar 17 10:49:14 UTC 2011


The following commit has been merged in the upstream branch:
commit 531e25836e1313cd508ab8394e16cf438a62ac7b
Author: Nick Lewis <nick at puppetlabs.com>
Date:   Wed Mar 9 12:55:52 2011 -0800

    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.

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

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list