Issue #6307 has been updated by Yongchao Gao.

Status changed from Unreviewed to Closed

using ${caller_module_name} fix it.
----------------------------------------
Bug #6307: $caller_module_name is always blank
https://projects.puppetlabs.com/issues/6307

Author: Yongchao Gao
Status: Closed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.6.2
Keywords: 
Branch: 


Here is my puppet script:

**modules/redarrow/manifests/add.pp:**


    define redarrow::add($type = "file") {
        file { "/etc/redarrow.conf/$name.conf":
            owner => "root",
            group => "root",
            mode => 644,
            source => $type ? {
                "file" => "puppet:///modules/$caller_module_name/redarrow.conf",
                default => undef,
            }, 
            content => $type ? {
                "template" => template("$caller_module_name/redarrow.erb"),
                default => undef,
            }, 
        }    
        notice($module_name)
        notice($caller_module_name)
    }


**modules/portage/manifests/init.pp:**

    redarrow::add {test_portage: }

Result: 
<pre>
(/Stage[main]/Portage/Redarrow::Add[test_portage]/File[/etc/redarrow.conf/test_portage.conf])
Could not evaluate: Error 400 on SERVER: Invalid module name; module names must 
be alphanumeric (plus '-'), not 'redarrow.conf' 
Could not retrieve file metadata for puppet:///modules//redarrow.conf: Error 
400 on SERVER: Invalid module name; module names must be alphanumeric (plus 
'-'), not 'redarrow.conf' at 
/home/flex/puppet/modules/redarrow/manifests/add.pp:14
</pre>

The notice prints $module_name correctly, but $caller_module_name is blank; it 
should be "portage", shouldn't it?

My puppet version is 2.6.2.


-- 
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