Could not find declared class transfer_contents

17 views
Skip to first unread message

Greg Heaphy

unread,
Mar 12, 2015, 1:42:03 PM3/12/15
to puppet...@googlegroups.com
Hi there, 


I am having trouble with Step two: Create a test manifests - specifially the application of tests manifests with the noop flag

my current configuration is as follows:

/home/redshelf/source/puppet
which contains: nothing

/etc/puppet/modules/transfer_contents/manifests/init.py
which contains:
    class transfer_contents {
        file { "/home/redshelf/source/puppet/rc.local":
                ensure => 'present',
                mode => '740',
                content => '#!/bin/sh
                            umount /dev/xvdb || :
                            mkswap /dev/xvdb
                            swapon /dev/xvdb
                            exit 0'
              }
    }


/etc/puppet/modules/transfer_contents/tests/init.py

which contains:

 class {'transfer_contents': }


I then run the command:

puppet apply --noop /etc/puppet/modules/transfer_contents/tests/init.pp

and I get:

Warning: Could not retrieve fact fqdn

Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class transfer_contents at /etc/puppet/modules/transfer_contents/tests/init.pp:1 on node redshelf-dev

Wrapped exception:

Could not find declared class transfer_contents

Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class transfer_contents at /etc/puppet/modules/transfer_contents/tests/init.pp:1 on node redshelf-dev




Adrien Thebo

unread,
Mar 12, 2015, 1:43:11 PM3/12/15
to puppet...@googlegroups.com
Hi Greg,

This file, "/etc/puppet/modules/transfer_contents/manifests/init.py", has a file extension of ".py". Puppet uses a file extension of ".pp". Try changing that and see if it resolves your issue.


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/4ce61c0a-48e6-4c32-810e-618c8d3b7bb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Adrien Thebo | Puppet Labs
Reply all
Reply to author
Forward
0 new messages