diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-11 18:16:52 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-11 18:16:52 +0000 |
commit | 37a059be9538bc90e09a17a45573fc44da6861b4 (patch) | |
tree | 466169ebd128df3d08ab561081e65f864dc8f208 /lib/puppet | |
parent | 374c830a217cd69f28797d8a771b725a0346b32e (diff) | |
download | puppet-37a059be9538bc90e09a17a45573fc44da6861b4.tar.gz puppet-37a059be9538bc90e09a17a45573fc44da6861b4.tar.xz puppet-37a059be9538bc90e09a17a45573fc44da6861b4.zip |
Most tests now pass in the whole system, but there are still about 8 cases that do not work. I am working on those now.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1904 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/gratr/adjacency_graph.rb | 3 | ||||
-rw-r--r-- | lib/puppet/gratr/digraph.rb | 5 | ||||
-rw-r--r-- | lib/puppet/pgraph.rb | 5 | ||||
-rw-r--r-- | lib/puppet/transaction.rb | 5 |
4 files changed, 16 insertions, 2 deletions
diff --git a/lib/puppet/gratr/adjacency_graph.rb b/lib/puppet/gratr/adjacency_graph.rb index 930e2abac..bea50e8c8 100644 --- a/lib/puppet/gratr/adjacency_graph.rb +++ b/lib/puppet/gratr/adjacency_graph.rb @@ -178,6 +178,9 @@ module GRATR alias graph_adjacent adjacent def adjacent(x, options={}) + unless @vertex_dict.has_key?(x) + raise ArgumentError, "%s is not a vertex" % x + end options[:direction] ||= :out if !x.kind_of?(GRATR::Edge) and (options[:direction] == :out || !directed?) if options[:type] == :edges diff --git a/lib/puppet/gratr/digraph.rb b/lib/puppet/gratr/digraph.rb index 2c4850d43..ae875376d 100644 --- a/lib/puppet/gratr/digraph.rb +++ b/lib/puppet/gratr/digraph.rb @@ -68,7 +68,10 @@ module GRATR # Reverse all edges in a graph def reversal return new(self) unless directed? - edges.inject(self.class.new) {|a,e| a << e.reverse} + result = self.class.new + edges.inject(result) {|a,e| a << e.reverse} + vertices.each { |v| result.add_vertex!(v) unless result.vertex?(v) } + result end # Return true if the Graph is oriented. diff --git a/lib/puppet/pgraph.rb b/lib/puppet/pgraph.rb index 58bee8605..bf156ed2d 100644 --- a/lib/puppet/pgraph.rb +++ b/lib/puppet/pgraph.rb @@ -68,7 +68,10 @@ class Puppet::PGraph < GRATR::Digraph next unless vertex.is_a?(type) leaves = other.leaves(vertex) - next if leaves.empty? + if leaves.empty? + remove_vertex!(vertex) + next + end # First create new edges for each of the :in edges adjacent(vertex, :direction => :in, :type => :edges).each do |edge| diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb index adb5eb134..d6d1669a1 100644 --- a/lib/puppet/transaction.rb +++ b/lib/puppet/transaction.rb @@ -143,6 +143,10 @@ class Transaction def eval_resource(resource) events = [] + if resource.is_a?(Puppet::Type::Component) + raise Puppet::DevError, "Got a component to evaluate" + end + if skip?(resource) @resourcemetrics[:skipped] += 1 else @@ -231,6 +235,7 @@ class Transaction # enough to check the immediate dependencies, which is why we use # a tree from the reversed graph. skip = false + resource.info "checking for failed deps" @relgraph.reversal.tree_from_vertex(resource, :dfs).keys.each do |dep| if fails = failed?(dep) resource.notice "Dependency %s[%s] has %s failures" % |