Skip to content

Commit be96256

Browse files
committed
Merge pull request #2739 from zaphod42/maint/stable/allow-prioritizer-to-be-used-in-tests
(maint) Use same prioritizer throughout catalog
2 parents 0ee1aad + 95ddc53 commit be96256

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/puppet/resource/catalog.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,14 @@ def apply(options = {})
184184
# The relationship_graph form of the catalog. This contains all of the
185185
# dependency edges that are used for determining order.
186186
#
187+
# @param given_prioritizer [Puppet::Graph::Prioritizer] The prioritization
188+
# strategy to use when constructing the relationship graph. Defaults the
189+
# being determined by the `ordering` setting.
187190
# @return [Puppet::Graph::RelationshipGraph]
188191
# @api public
189-
def relationship_graph
192+
def relationship_graph(given_prioritizer = nil)
190193
if @relationship_graph.nil?
191-
@relationship_graph = Puppet::Graph::RelationshipGraph.new(prioritizer)
194+
@relationship_graph = Puppet::Graph::RelationshipGraph.new(given_prioritizer || prioritizer)
192195
@relationship_graph.populate_from(self)
193196
end
194197
@relationship_graph

lib/puppet/transaction.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def changed?
138138
end
139139

140140
def relationship_graph
141-
catalog.relationship_graph
141+
catalog.relationship_graph(@prioritizer)
142142
end
143143

144144
def resource_status(resource)

0 commit comments

Comments
 (0)