On Tue, Dec 06, 2011 at 01:38:38PM -0800, Nan Liu wrote:
> On Tue, Dec 6, 2011 at 12:27 PM, Christian G. Warden <cwar...@xerus.org> 
> wrote:
> > Do explicit class dependencies work?
> > This simple example fails with:
> > Could not find resource 'Class[Config]' for relationship on 
> > 'Class[Uses_config]'
> >
> >        class config {
> >        }
> >
> >        class uses_config {
> >          Class['config'] -> Class['uses_config']
> >        }
> >
> >        include uses_config
> >
> > Am I doing something?
> 
> You didn't declare include class config. If you intend uses_config to
> automatically include class config, you should declare it there. In
> either case you are missing include config or class { config: }
> somewhere.

Thanks, Nan.  Sorry, I got a little overzealous in trying to come up
with a minimal example.  Here's the problem I was actually trying to
troubleshoot:
class config {
  $x = 'abc'
}

class uses_config {
  Class['config'] -> Class['uses_config']
  $x = $config::x
}

include uses_config
include config

This results in:
warning: Scope(Class[Uses_config]): Could not look up qualified variable 
'config::x'; class config has not been evaluated

I think it's similar to the problem I asked about with tags in another thread.
If I include config before uses_config, I don't get an error.

Christian

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to