"defined($classname)" will return true if puppet code that describes the named class can be found, whether or not the class has been included. On the other hand, "defined(File[$filename])" will only return true if the code describing the file has been evaluated and the file "instantiated" (difficult to find the right words to describe how puppet behaves, given it''s eccentric use of words like "class" and "define"). These are really two significantly different meanings to "defined" and I wonder if it''s helpful to be using the same function for both. I do think it''s potentially confusing. This isn''t an idle line of thought, by the way. There''s obviously a lot of interest in class/module dependencies, which are not easy to create or test. Puppet would benefit from having a test for whether or not a specific class has been included and, I think, for whether or not a specific class *or one that inherits from it* has been included. -- Bruce A problem shared brings the consolation that someone else is now feeling as miserable as you. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, Mar 19, 2009 at 10:12:39AM +0000, Bruce Richardson wrote:> This isn''t an idle line of thought, by the way. There''s obviously a lot > of interest in class/module dependencies, which are not easy to create > or test. Puppet would benefit from having a test for whether or not a > specific class has been included and, I think, for whether or not a > specific class *or one that inherits from it* has been included.It''s nice to find, though, that "require => Class[$classname]" will create a dependency on $classname *or any class that inherits from it*. I don''t think that''s documented anywhere - hope I can remember my username/password on the wiki. -- Bruce Bitterly it mathinketh me, that I spent mine wholle lyf in the lists against the ignorant. -- Roger Bacon, "Doctor Mirabilis" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 19, 2009, at 5:21 AM, Bruce Richardson wrote:> > On Thu, Mar 19, 2009 at 10:12:39AM +0000, Bruce Richardson wrote: >> This isn''t an idle line of thought, by the way. There''s obviously >> a lot >> of interest in class/module dependencies, which are not easy to >> create >> or test. Puppet would benefit from having a test for whether or >> not a >> specific class has been included and, I think, for whether or not a >> specific class *or one that inherits from it* has been included. > > It''s nice to find, though, that "require => Class[$classname]" will > create a dependency on $classname *or any class that inherits from > it*. > I don''t think that''s documented anywhere - hope I can remember my > username/password on the wiki.The whole inheritance tree is connected on the graph, so requiring the top of the tree implicitly requires everythimg under it. Basically, relationships just make a new edge in the DAG (directed acyclic graph), and the edges are what determine the sorting order. -- Beware of all enterprises that require new clothes. -- Henry David Thoreau --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---