I want to create native types (despite that fact that apparently nobody
wants to) to manage a variety of resources under a common namespace.
However, I can''t seem to get the namespacing going right.
With a defined type, I can do this:
define backup_ninja::config(blah, baz) {
...
}
But that''s not much use to me, as a defined type just isn''t
going to cut the
mustard -- I''m after a parsed file type.
When I try to do this, instead (in a file named backup_ninja::config.rb):
Puppet::Type.newtype(''backup_ninja::config'') do
...
end
and this in site.pp:
node ''hussy'' {
backup_ninja::config { ''/tmp/bn.conf'':
loglevel => 3,
usecolors => false,
reportemail => "mpalmer@hussy.hezmatt.org"
}
}
I get the world''s *weirdest* error:
err: Puppet::Parser::AST::ResourceDef failed with error NameError: wrong
constant name Backup_ninja::config at site.pp:6
Is anyone namespacing native types? Should I be able to namespace native
types?
- Matt
--
Everybody knows that a hail of _edge-sharpened_ AOL CDs is the _polite_ way
of saying "keep the noise down, chaps".
-- Tanuki, ASR
On Nov 8, 2007, at 3:56 PM, Matthew Palmer wrote:> > Is anyone namespacing native types? Should I be able to namespace > native > types?Huh, I''d never thought of this, but no, you can''t namespace native types. Each type name is converted to a constant internally (yes, I know you hate this, and I''ll probably be changing it when I refactor the RAL API next year), and ''one::two'' can''t get converted into a constant in Ruby-world without some special handling. Certainly an interesting idea, but at this point, you''ll have to forego using qualified native types. -- Humphrey''s Law of the Efficacy of Prayer: In a dangerous world there will always be more people around whose prayers for their own safety have been answered than those whose prayers have not. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com