Issue #19315 has been updated by James Shubin.
I appreciate your replies. You're definitely a pro, and you have some great answers! With the state that the puppet language is in at the moment, I think there are still some use cases where hashes work best, but I believe it's possible that new language features in the future might obsolete this. This doesn't mean that there aren't necessarily alternate ways to code something or possible workarounds. I've found some for my code, for now anyways. To get more on topic, the real reason I opened this bug, is that the hash as $name behaviour works perfectly when run locally, and (i think) fails randomly when run through a puppetmaster. so: 1) If possible, I'd like for hashes to work as $name's, but maybe they don't make sense long term. 2) I think it's a bug that running something with the puppetmaster vs. puppet apply (locally) acts differently (other than the obvious differences that make sense) - Does it make sense for me to open a new bug for this? - I at least expect both to work, or both to fail, but in the same way. 3) That when running through puppetmaster it doesn't fail consistently worries me, as I expect puppet to be completely deterministic. Does it make sense for me to open a new bug for this? - I expect the same result, for the same initial conditions, every time. I can't remember if I had this problem with 3.x or 2.7.x, maybe both. In any case, thank you for the discussion, and let me know if there is any way that I can help with this situation to improve puppet. Thank you, James ---------------------------------------- Bug #19315: puppet is buggy when using a hash as a $name https://projects.puppetlabs.com/issues/19315#change-83908 Author: James Shubin Status: Unreviewed Priority: Normal Assignee: Category: Target version: Affected Puppet version: Keywords: Branch: <pre> It turns out if you're doing some fancy puppet work, it is sometimes useful to use a hash as a $name var. In my particular case, I'm actually passing an array of hashes to a define (which ultimately causes the define to be called once for each hash). This actually works perfectly when run locally with puppet apply, however when running with puppet agent --test, it sometimes works and sometimes fails with: Error: Could not retrieve catalog from remote server: Could not intern from pson: Could not convert from pson: Could not find relationship source "Foo::Bar::My_define[sourcedmzaddress192.168.101.200]" The hash I used was: {'source' => 'dmz', 'address' => '192.168.101.200'} A few comments: 1. It's strange that the execution is not deterministic. Why does it sometimes work and sometimes not? 2. It's odd that it *always* works locally, but not always when through the puppet master. 3. The error message is confusing, not sure what it is trying to tell me. Thanks, James </pre> -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.