Puppet: System Administration Automated

Support

Ticket #787 (closed defect: fixed)

Opened 1 year ago

Last modified 9 months ago

Cannot use multiple realize function calls with virtual defined resources

Reported by: jtimberman Assigned to: luke
Priority: normal Milestone: misspiggy
Component: library Version:
Severity: normal Keywords:
Cc: Triage Stage: Accepted
Attached Patches: None Complexity: Unknown

Description (Last modified by DavidS)

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

Change History

09/06/07 19:14:55 changed by michael

  • stage changed from Unreviewed to Accepted.
  • milestone set to misspiggy.

11/09/07 00:05:07 changed by DavidS

  • description changed.

added URL to mailinglist thread

11/21/07 00:16:55 changed by luke

  • summary changed from Cannot use multiple realize function calls to Cannot use multiple realize function calls with virtual defined resources.

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]", "Yay[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'.

11/21/07 00:48:47 changed by luke

Partially fixed in [cca613d0f142e492aab8cb58087e2a6299334f7d].

11/21/07 17:51:00 changed by luke

  • status changed from new to closed.
  • resolution 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.