Forum: CFEngine Help Subject: Intended behavior for vars in parametrized bundle? Author: sauer Link to topic: https://cfengine.com/forum/read.php?3,23611,23611#msg-23611
Say I have a bundle which takes a parameter, and then I refer to that bundle a nmber of times with different parameters. Is there an expected state for variables within that bundle? In other words, which iteration of a bundle does a scoped reference, well, refer to? For an untested example: bundle agent master { vars: "pie" slist => {"apple", "cherry", "huckleberry"}; methods: "blaster" usebundle => blaster("$(pie)"); reports: "We were left with '$(blaster.f)' in blaster's f"; } bundle agent blaster (f){ vars: "thisflavor" string => "$(f)"; } Yeah, I suppose I could emperically figure out what's going on, but someone has to have thought about this before, so I'm wondering what the decision was. I'd feel better if I was validating that a design decision operates as expected, rather than guessing at how things are probably supposed to work. And posting up here's easier than reading the full source code (although that's certainly on my list of things to do). :) Or is this just something that should be avoided due to its somewhat sketchy nature, and it's left at that? _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine