Codebase list facter / 1538564
Merge pull request #204 from jeffweiss/ticket/master/11466_remove_duplicate_memorytotal_fact (#11466) Remove deprecated memorytotal fact Daniel Pittman 12 years ago
2 changed file(s) with 2 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
260260 memtotal = Facter::Util::Resolution.exec("sysctl -n hw.physmem")
261261 Facter::Memory.scale_number(memtotal.to_f,"")
262262 end
263 end
264
265 # http://projects.puppetlabs.com/issues/11436
266 #
267 # Unifying naming for the amount of physical memory in a given host.
268 # This fact is DEPRECATED and will be removed in Facter 2.0 per
269 # http://projects.puppetlabs.com/issues/11466
270 Facter.add("MemoryTotal") do
271 setcode do
272 Facter.value("memorysize")
273 end
274 end
263 end
141141 computer.stubs(:TotalPhysicalMemory).returns("4193837056")
142142 Facter::Util::WMI.stubs(:execquery).returns([computer])
143143
144 Facter.fact(:MemoryTotal).value.should == '3.91 GB'
144 Facter.fact(:MemorySize).value.should == '3.91 GB'
145145 end
146146 end
147
148 it "should use the memorysize fact for the memorytotal fact" do
149 Facter.fact("memorysize").expects(:value).once.returns "yay"
150 Facter::Util::Resolution.expects(:exec).never
151 Facter::Memory.expects(:meminfo_number).never
152 Facter.fact("memorytotal").value.should == "yay"
153 end
154147 end