On Friday, October 5, 2018 at 8:20:51 AM UTC-7, Eirik Øverby wrote:
>
> On Tuesday, August 28, 2018 at 6:50:48 PM UTC+3, Branan Purvine-Riley 
> wrote:
>
>> Hi Jon,
>>
>> In Puppet 6 we're going to start requiring that the names of 
>> classes/defines match the name that's implied by their file path[1]. We 
>> added that deprecation warning in 5.5.6[2] as part of a push to get 
>> upcoming Puppet 6 changes printing warnings whenever possible.
>>
>> [1] https://tickets.puppetlabs.com/browse/PUP-1434 and 
>> https://tickets.puppetlabs.com/browse/PUP-4242
>> [2] https://tickets.puppetlabs.com/browse/PUP-8894
>>
>
> Since 5.5.6 our puppetserver has been issuing warnings of this kind:
> Puppet Unacceptable location. The name 'bash' is unacceptable in file 
> '/usr/local/etc/puppet/modules.common/bash/manifests/init.pp'
>
> The init.pp file contains only this:
> class bash {
>     package { "shells/bash":
>         ensure => installed,
>     }
> }
>
> I am at a loss as to how I'm supposed to refactor this to make the warning 
> go away. We do need an init.pp, and I know that for style points we should 
> split this into a base class and a ::install class, but I refuse to believe 
> that this is *required* for something as simple as the above. I am also not 
> finding the documentation particularly helpful in this simple use-case. It 
> does look like it's complaining about absolutely every class we have 
> defined, no matter if we use only init.pp or properly-defined 
> directory/file hierarchy and -naming for the classes, defines, etc.
>
> Can someone help me nudge my neurons in a way that I understand what is 
> expected of me?
>
> /Eirik 
>

Hi Eirik,

I was unable to reproduce your issue in Puppet 5.5.6 (aka SHA 60de165 
from https://github.com/puppetlabs/puppet/releases):

kris.bosland@kris:puppet % git checkout 60de165                            
                                                                            
                            ±[5.5.6^0]
HEAD is now at 60de165b86... Merge pull request #7007 from 
justinstoller/maint-pin-rake-more
kris.bosland@kris:puppet % cat ../tmp/test/bash/manifests/init.pp          
                                                                            
                            ±[5.5.6^0]
class bash {
    package { "shells/bash":
        ensure => installed,
    }
}

class smash {
    package { "shells/bash":
        ensure => installed,
    }
}
kris.bosland@kris:puppet % bx puppet apply --modulepath ../tmp/test -e 
'class test { include bash }; include test'                                
                                 ±[5.5.6^0]
Warning: Unacceptable location. The name 'smash' is unacceptable in file 
'/Users/kris.bosland/work/tmp/test/bash/manifests/init.pp' (file: 
/Users/kris.bosland/work/tmp/test/bash/manifests/init.pp, line: 7, column: 
1)
Notice: Compiled catalog for kris.bosland-c02kf9eafft1 in environment 
production in 0.56 seconds
Error: Mac OS X PKG DMGs must specify a package source.
Error: /Stage[main]/Bash/Package[shells/bash]/ensure: change from 'absent' 
to 'present' failed: Mac OS X PKG DMGs must specify a package source.
Notice: Applied catalog in 0.02 seconds
kris.bosland@kris:puppet %

Note that Puppet complains about the class 'smash' in the 'bash' module, 
but not the class 'bash'.

Can you provide a more detailed example that fails for you?

Thanks.

-Kris

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/843a35f0-4c1b-47fc-936c-708afedde507%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to