Issue #1372 has been updated by Lee Lowder.

In addition to using param style syntax as a workaround, a properly constructed 
regex will work.

    llowder@ubuntu:~$ cat bugtest.pp
    class ubuntu {
      $foo = "bar"
      notice ("Class ubuntu")
    }
    node /ubunt./ {
      #class { 'ubuntu': }
      include ::ubuntu
      notice ("Node ubuntu")
      notice ("class::ubuntu::foo is ${ubuntu::foo}")
    }
    #class { 'ubuntu': }

    llowder@ubuntu:~$ puppet apply --verbose bugtest.pp
    notice: Scope(Class[Ubuntu]): Class ubuntu
    notice: Scope(Node[ubunt.]): Node ubuntu
    notice: Scope(Node[ubunt.]): class::ubuntu::foo is bar
    info: Applying configuration version '1353019533'
    notice: Finished catalog run in 0.02 seconds

One thing to notice, that using a regex of /ubuntu/ results in the class not 
loading:

    llowder@ubuntu:~$ cat bugtest.pp
    class ubuntu {
      $foo = "bar"
      notice ("Class ubuntu")
    }
    node /ubuntu/ {
      #class { 'ubuntu': }
      include ::ubuntu
      notice ("Node ubuntu")
      notice ("class::ubuntu::foo is ${ubuntu::foo}")
    }
    #class { 'ubuntu': }

    llowder@ubuntu:~$ puppet apply --verbose bugtest.pp
    notice: Scope(Node[ubuntu]): Node ubuntu
    notice: Scope(Node[ubuntu]): class::ubuntu::foo is
    info: Applying configuration version '1353019657'
    notice: Finished catalog run in 0.01 seconds

----------------------------------------
Bug #1372: Class names that match the node name are not evaluated
https://projects.puppetlabs.com/issues/1372#change-76744

Author: Digant Kasundra
Status: Accepted
Priority: Normal
Assignee: 
Category: language
Target version: 2.7.x
Affected Puppet version: 0.24.4
Keywords: devtriage
Branch: 


If I setup:

class subversion {
  warning("I am class subversion")
}

and in my nodes.pp I have

node subversion { include subversion }

When i run puppet in verbose mode on subversion, I never see that warning.  


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to