summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@reductivelabs.com>2010-01-20 01:50:27 -0800
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commita9fc13409db7147918eeeb47e91315c6eb980432 (patch)
tree0a67adce342a5cfff806ea183d749c1fb4aad764 /lib/puppet
parenta18769da31e03e05277d6ad52ca1f38acee5ecbd (diff)
downloadpuppet-a9fc13409db7147918eeeb47e91315c6eb980432.tar.gz
puppet-a9fc13409db7147918eeeb47e91315c6eb980432.tar.xz
puppet-a9fc13409db7147918eeeb47e91315c6eb980432.zip
Removing mention of @changes in Transaction
This is handled in the Status instances now. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/transaction.rb50
1 files changed, 2 insertions, 48 deletions
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb
index b49d12266..f8c7a859a 100644
--- a/lib/puppet/transaction.rb
+++ b/lib/puppet/transaction.rb
@@ -74,19 +74,9 @@ class Puppet::Transaction
resource.err "Could not evaluate: #{detail}"
end
- # Apply each change in turn.
- def apply_changes(resource, changes)
- changes.each { |change| apply_change(resource, change) }
- end
-
# Find all of the changed resources.
def changed?
- @changes.find_all { |change| change.changed }.collect do |change|
- unless change.property.resource
- raise "No resource for %s" % change.inspect
- end
- change.property.resource
- end.uniq
+ report.resource_statuses.values.find_all { |status| status.changed }.collect { |status| catalog.resource(status.resource) }
end
# Do any necessary cleanup. If we don't get rid of the graphs, the
@@ -139,8 +129,6 @@ class Puppet::Transaction
def eval_children_and_apply_resource(resource)
@resourcemetrics[:scheduled] += 1
- changecount = @changes.length
-
# We need to generate first regardless, because the recursive
# actions sometimes change how the top resource is applied.
children = eval_generate(resource)
@@ -163,10 +151,6 @@ class Puppet::Transaction
end
end
- unless children.empty?
- @changes[changecount..-1].each { |change| change.proxy = resource }
- end
-
# Keep track of how long we spend in each type of resource
@timemetrics[resource.class.name] += seconds
end
@@ -203,7 +187,7 @@ class Puppet::Transaction
Puppet::Util::Log.close(@report)
end
- Puppet.debug "Finishing transaction #{object_id} with #{@changes.length} changes"
+ Puppet.debug "Finishing transaction #{object_id}"
end
def events
@@ -316,9 +300,6 @@ class Puppet::Transaction
# Metrics for distributing times across the different types.
@timemetrics = Hash.new(0)
- # The changes we're performing
- @changes = []
-
# The resources that have failed and the number of failures each. This
# is used for skipping resources because of failed dependencies.
@failures = Hash.new do |h, key|
@@ -404,33 +385,6 @@ class Puppet::Transaction
report.resource_statuses[resource.to_s]
end
- # Roll all completed changes back.
- def rollback
- @changes.reverse.collect do |change|
- begin
- event = change.backward
- rescue => detail
- Puppet.err("%s rollback failed: %s" % [change,detail])
- if Puppet[:trace]
- puts detail.backtrace
- end
- next
- # at this point, we would normally do error handling
- # but i haven't decided what to do for that yet
- # so just record that a sync failed for a given resource
- #@@failures[change.property.parent] += 1
- # this still could get hairy; what if file contents changed,
- # but a chmod failed? how would i handle that error? dern
- end
-
- # And queue the events
- event_manager.queue_event(change.resource, event)
-
- # Now check to see if there are any events for this child.
- event_manager.process_events(change.property.resource)
- end
- end
-
# Is the resource currently scheduled?
def scheduled?(resource)
self.ignoreschedules or resource.scheduled?