On Dec 22, 2008, at 6:37 PM, Jeffrey McCune wrote:
> +module Puppet::Util::Mcx
> + class MCXUtilException < Exception
> +
> + end
> +
> + # Given the resource name string, parse ds_type out.
> + def parse_type(name)
> + tmp = name.split('/')[1]
> + if ! tmp.is_a? String
> + raise MCXUtilException,
> + "Coult not parse ds_type from resource name '#{name}'.
> Specify with ds_type parameter."
> + end
> + # De-pluralize and downcase.
> + tmp = tmp.chop.downcase.to_sym
> + if not TypeMap.keys.member? tmp
> + raise MCXUtilException,
> + "Coult not parse ds_type from resource name '#{name}'.
> Specify with ds_type parameter."
> + end
The rest of this looks good (sorry for the late review), but where
does this TypeMap come from? I expect the constant should be qualified.
--
Life is like playing a violin in public and learning the instrument as
one goes on. -- Samuel Butler
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---