Bug #787

Cannot use multiple realize function calls with virtual defined resources

Added by Joshua Timberman over 4 years ago. Updated over 4 years ago.

Status:Closed Start date:
Priority:Normal Due date:
Assignee:Luke Kanies % Done:

0%

Category:-
Target version:0.24.0
Affected Puppet version:0.25.4 Branch:
Keywords:
Votes: 0

Description

Per mailing list traffic (http://mail.madstop.com/pipermail/puppet-users/2007-August/004105.html), this doesn’t work:

http://pastie.caboo.se/90393

But this does:

http://pastie.caboo.se/90395

History

Updated by David Schmitt over 4 years ago

added URL to mailinglist thread

Updated by Luke Kanies over 4 years ago

The problem here is that the virtual definitions are getting evaluated on the first pass, which means they aren’t available for realizing on the next pass. E.g., given this code:

define yay {
    notify { "Testing $name": }
}
@yay { one: }
@yay { two: }
@yay { three: }
realize(Yay[[one]])
realize(Yay[[two]])

And some debugging, this is what you get:

Realizing Yay[one]
Looking for Yay[one]
[[Yay[one]" "Yaycommit:three]" "Yay[two]]]
Realizing Yay[two
Looking for Yay[two]
[[Notify[Testing one]" "Notify[Testing three]" "Notify[Testing two]]]
Could not find Yay[two]
Failed to realize virtual resources Yay[two]

Something is causing all of the defined resources to be evaluated, such that they’re converted to the contained resources and are no longer available to ‘realize’.

Updated by Luke Kanies over 4 years ago

Partially fixed in commit:cca613d0f142e492aab8cb58087e2a6299334f7d.

Updated by Luke Kanies over 4 years ago

  • Status changed from 1 to Closed
  • 7 set to fixed

That commit seems to have entirely fixed the problem. I can’t reproduce any issues around multiple realize calls in different scopes or anything.

Also available in: Atom PDF