The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #5226

Ambiguous "Cannot find definition Class at..."

Added by Dan Trainor over 3 years ago. Updated over 1 year ago.

Status:AcceptedStart date:11/08/2010
Priority:LowDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Affected Puppet version:2.6.2 Branch:
Keywords:Cannot find definition Class

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket may be automatically exported to the PUP project on JIRA using the button below:


Description

Hi –

Given a sniplet of code inside a class that checks for the existence of a class:


if (!defined(Class["postfix::smtprelay"])) {
    include "postfix"
}

One would see the following in logs:

Nov  8 09:41:24 puppet01 puppet-master[19166]: Cannot find definition Class at /etc/puppet/manifests/nodes.pp:264 on node search01.vmserver08.test.az.domain.local

A couple of thoughts come to mind:

1) Should this even be reported? Is programmatic logic something that should always be displayed? Granted, the class is clearly not found because its not defined, but that would still be considered normal behavior.

2) Even if it is to be included, it should be less ambiguous. Although one can easily find and then (correctly) assume what the warning is about given this information, it does take time.

Thanks!

History

#1 Updated by Nigel Kersten over 3 years ago

  • Status changed from Unreviewed to Accepted

#2 Updated by Nigel Kersten over 3 years ago

  • Target version deleted (69)

I really dislike the defined() function :(

Also available in: Atom PDF