diff options
author | Matt Robinson <matt@puppetlabs.com> | 2010-09-21 14:41:17 -0700 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2010-11-10 05:58:07 +1100 |
commit | 6e6712b543949bc5bb98e63cfdf4112c79adc28c (patch) | |
tree | 893361e83643ab109990dc6b6af208a2f638935d /lib/puppet/rails | |
parent | 956296a74c701fee79d8eed898ce64da02c983de (diff) | |
download | puppet-6e6712b543949bc5bb98e63cfdf4112c79adc28c.tar.gz puppet-6e6712b543949bc5bb98e63cfdf4112c79adc28c.tar.xz puppet-6e6712b543949bc5bb98e63cfdf4112c79adc28c.zip |
[#4813] Remove dead code from puppet/rails/host.rb
def self.clean – became orphaned in commit 28cee40689440388994a4768bd301ae32c8ecc05
def self.store – became orphaned in commit 863c50b1273a7fa48d74fb74948938214b45967c
def fact – was added as a helper method for unit tests in commit
9f4870637ce57d548d23c0b3330200014327c268. The test file that used this
method was removed in commit 93246c0c70796a606fc8c05b51e1feb09c94e377
def update_connect_time – Not sure when this was ever used.
I also ran a client master storeconfigs run a few times and didn’t see
any problems, so I’m pretty sure deleting these methods is safe.
Diffstat (limited to 'lib/puppet/rails')
-rw-r--r-- | lib/puppet/rails/host.rb | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/lib/puppet/rails/host.rb b/lib/puppet/rails/host.rb index 986cebd0a..b9dea2a3d 100644 --- a/lib/puppet/rails/host.rb +++ b/lib/puppet/rails/host.rb @@ -16,16 +16,6 @@ class Puppet::Rails::Host < ActiveRecord::Base belongs_to :source_file has_many :resources, :dependent => :destroy, :class_name => "Puppet::Rails::Resource" - # If the host already exists, get rid of its objects - def self.clean(host) - if obj = self.find_by_name(host) - obj.rails_objects.clear - return obj - else - return nil - end - end - def self.from_puppet(node) host = find_by_name(node.name) || new(:name => node.name) @@ -38,63 +28,6 @@ class Puppet::Rails::Host < ActiveRecord::Base host end - # Store our host in the database. - def self.store(node, resources) - args = {} - - host = nil - railsmark "Stored node" do - transaction do - #unless host = find_by_name(name) - - debug_benchmark("Searched for host")do - unless host = find_by_name(node.name) - host = new(:name => node.name) - end - end - if ip = node.parameters["ipaddress"] - host.ip = ip - end - - if env = node.environment - host.environment = env - end - - # Store the facts into the database. - host.merge_facts(node.parameters) - - debug_benchmark("Handled resources") { - host.merge_resources(resources) - } - - host.last_compile = Time.now - - debug_benchmark("Saved host") { - host.save - } - end - - end - - # This only runs if time debugging is enabled. - write_benchmarks - - host - end - - # Return the value of a fact. - def fact(name) - - if fv = self.fact_values.find( - :all, :include => :fact_name, - - :conditions => "fact_names.name = '#{name}'") - return fv - else - return nil - end - end - # returns a hash of fact_names.name => [ fact_values ] for this host. # Note that 'fact_values' is actually a list of the value instances, not # just actual values. @@ -305,11 +238,6 @@ class Puppet::Rails::Host < ActiveRecord::Base end end - def update_connect_time - self.last_connect = Time.now - save - end - def to_puppet node = Puppet::Node.new(self.name) {"ip" => "ipaddress", "environment" => "environment"}.each do |myparam, itsparam| |