Use of camelCase causes issues in dependancy resolution

293 views
Skip to first unread message

Abhijeet Rastogi

unread,
Aug 13, 2012, 5:40:16 AM8/13/12
to puppet...@googlegroups.com
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

Stephen Gran

unread,
Aug 13, 2012, 5:43:25 AM8/13/12
to puppet...@googlegroups.com
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,
> --
> 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...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users
> +unsub...@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

Abhijeet R

unread,
Aug 13, 2012, 6:53:17 AM8/13/12
to puppet...@googlegroups.com, Stephen Gran
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?
Regards,
Abhijeet
http://blog.abhijeetr.com
Reply all
Reply to author
Forward
0 new messages