Abhijeet Rastogi
2012-Aug-13 09:40 UTC
[Puppet Users] Use of camelCase causes issues in dependancy resolution
Hi, Please have a look at this init.pp file. https://github.com/shadyabhi/puppet-t/blob/master/modules/php/manifests/init.pp In short, I have defined two classes that do some stuff & then I define that the resources in one class should be executed before the resources of the other class by using Class[''php_install''] -> Class[''php_remove_unwanted''] If instead of using underscores in classes, I use classes with camel casing (for ex phpInstall instead of php_install & phpRemoveUnwanted instead of php_remove_unwanted), I get the error err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find resource ''Class[Phpinstall]'' for relationship on ''Class[Phpremo veunwanted]'' on node dbm.g1.foo Is there a convention I shoud follow while defining classes? I couldn''t find anywhere that said that I cannot use camel-casing while defining classes. Regards, Abhijeet http://blog.abhijeetr.com -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/wOP78S9anc8J. 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.
Stephen Gran
2012-Aug-13 09:43 UTC
Re: [Puppet Users] Use of camelCase causes issues in dependancy resolution
Hi, http://docs.puppetlabs.com/guides/language_guide.html "Class names, module names, and the names of defined and custom resource types should be restricted to lowercase alphanumeric characters and underscores, and should begin with a lowercase letter; that is, they should match the expression [a-z][a-z0-9_]*. Although some names that violate these restrictions currently work, using them is not recommended. Hyphens are very strongly discouraged, and in most versions of Puppet will cause variables inside the class to be unavailable elsewhere." Cheers, On Mon, 2012-08-13 at 02:40 -0700, Abhijeet Rastogi wrote:> Hi, > > Please have a look at this init.pp file. > https://github.com/shadyabhi/puppet-t/blob/master/modules/php/manifests/init.pp > > In short, I have defined two classes that do some stuff & then I > define that the resources in one class should be executed before the > resources of the other class by using > > Class[''php_install''] -> Class[''php_remove_unwanted''] > > If instead of using underscores in classes, I use classes with camel > casing (for ex phpInstall instead of php_install & phpRemoveUnwanted > instead of php_remove_unwanted), I get the error > > err: Could not retrieve catalog from remote server: Error 400 on > SERVER: Could not find resource ''Class[Phpinstall]'' for relationship > on ''Class[Phpremo > veunwanted]'' on node dbm.g1.foo > > Is there a convention I shoud follow while defining classes? I > couldn''t find anywhere that said that I cannot use camel-casing while > defining classes. > > Regards, > Abhijeet > http://blog.abhijeetr.com > > > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/wOP78S9anc8J. > 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.-- Stephen Gran Senior Systems Integrator - guardian.co.uk Please consider the environment before printing this email. ------------------------------------------------------------------ Visit guardian.co.uk - newspaper of the year www.guardian.co.uk www.observer.co.uk www.guardiannews.com On your mobile, visit m.guardian.co.uk or download the Guardian iPhone app www.guardian.co.uk/iphone and iPad edition www.guardian.co.uk/iPad Save up to 37% by subscribing to the Guardian and Observer - choose the papers you want and get full digital access. Visit guardian.co.uk/subscribe --------------------------------------------------------------------- This e-mail and all attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender and delete the e-mail and all attachments immediately. Do not disclose the contents to another person. You may not use the information for any purpose, or store, or copy, it in any way. Guardian News & Media Limited is not liable for any computer viruses or other material transmitted with or as part of this e-mail. You should employ virus checking software. Guardian News & Media Limited A member of Guardian Media Group plc Registered Office PO Box 68164 Kings Place 90 York Way London N1P 2AP Registered in England Number 908396 -- 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.
Abhijeet R
2012-Aug-13 10:53 UTC
Re: [Puppet Users] Use of camelCase causes issues in dependancy resolution
Thanks Stephen. It would have been great if violating the rule created error/warning while doing puppet test runs. Isn''t it the desirable way to avoid bugs while doing dependency resolution? On Mon 13 Aug 2012 03:13:25 PM IST, Stephen Gran wrote:> Hi, > > http://docs.puppetlabs.com/guides/language_guide.html > > "Class names, module names, and the names of defined and custom resource > types should be restricted to lowercase alphanumeric characters and > underscores, and should begin with a lowercase letter; that is, they > should match the expression [a-z][a-z0-9_]*. Although some names that > violate these restrictions currently work, using them is not > recommended. Hyphens are very strongly discouraged, and in most versions > of Puppet will cause variables inside the class to be unavailable > elsewhere." > > Cheers, > > On Mon, 2012-08-13 at 02:40 -0700, Abhijeet Rastogi wrote: >> Hi, >> >> Please have a look at this init.pp file. >> https://github.com/shadyabhi/puppet-t/blob/master/modules/php/manifests/init.pp >> >> In short, I have defined two classes that do some stuff & then I >> define that the resources in one class should be executed before the >> resources of the other class by using >> >> Class[''php_install''] -> Class[''php_remove_unwanted''] >> >> If instead of using underscores in classes, I use classes with camel >> casing (for ex phpInstall instead of php_install & phpRemoveUnwanted >> instead of php_remove_unwanted), I get the error >> >> err: Could not retrieve catalog from remote server: Error 400 on >> SERVER: Could not find resource ''Class[Phpinstall]'' for relationship >> on ''Class[Phpremo >> veunwanted]'' on node dbm.g1.foo >> >> Is there a convention I shoud follow while defining classes? I >> couldn''t find anywhere that said that I cannot use camel-casing while >> defining classes. >> >> Regards, >> Abhijeet >> http://blog.abhijeetr.com >> >> >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Puppet Users" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/puppet-users/-/wOP78S9anc8J. >> 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. >-- Regards, Abhijeet http://blog.abhijeetr.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.