Please review pull request #204: (#11466) Remove deprecated memorytotal fact opened by (jeffweiss)

Description:

The memorytotal fact was previously deprecated in preference to the
memorysize fact. This commit now removes memorytotal.

This commit is a breaking change that will force any remaining
memorytotal fact users to switch to the preferred memorysize fact.

  • Opened: Sat May 12 05:50:45 UTC 2012
  • Based on: puppetlabs:master (1bd98fd94b5e577216b80789ee9f933dd5cc74f8)
  • Requested merge: jeffweiss:ticket/master/11466_remove_duplicate_memorytotal_fact (9810595b04e68014ed5b587b01b75c712cbba2f5)

Diff follows:

diff --git a/lib/facter/memory.rb b/lib/facter/memory.rb
index 2bb52ad..9e97795 100644
--- a/lib/facter/memory.rb
+++ b/lib/facter/memory.rb
@@ -261,15 +261,4 @@
     memtotal = Facter::Util::Resolution.exec("sysctl -n hw.physmem")
     Facter::Memory.scale_number(memtotal.to_f,"")
   end
-end
-
-# http://projects.puppetlabs.com/issues/11436
-#
-# Unifying naming for the amount of physical memory in a given host.
-# This fact is DEPRECATED and will be removed in Facter 2.0 per
-# http://projects.puppetlabs.com/issues/11466
-Facter.add("MemoryTotal") do
-  setcode do
-    Facter.value("memorysize")
-  end
-end
+end
\ No newline at end of file
diff --git a/spec/unit/memory_spec.rb b/spec/unit/memory_spec.rb
index 5e85239..c40cdf3 100755
--- a/spec/unit/memory_spec.rb
+++ b/spec/unit/memory_spec.rb
@@ -142,14 +142,7 @@
       computer.stubs(:TotalPhysicalMemory).returns("4193837056")
       Facter::Util::WMI.stubs(:execquery).returns([computer])
 
-      Facter.fact(:MemoryTotal).value.should == '3.91 GB'
+      Facter.fact(:MemorySize).value.should == '3.91 GB'
     end
   end
-
-  it "should use the memorysize fact for the memorytotal fact" do
-    Facter.fact("memorysize").expects(:value).once.returns "yay"
-    Facter::Util::Resolution.expects(:exec).never
-    Facter::Memory.expects(:meminfo_number).never
-    Facter.fact("memorytotal").value.should == "yay"
-  end
 end

    

--
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.

Reply via email to