~ubuntu-branches/ubuntu/lucid/puppet/lucid

« back to all changes in this revision

Viewing changes to lib/puppet/parser/ast/resource_reference.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-12-23 00:48:10 UTC
  • mfrom: (1.1.10 upstream) (3.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091223004810-3i4oryds922g5n59
Tags: 0.25.1-3ubuntu1
* Merge from debian testing.  Remaining changes:
  - debian/rules:
    + Don't start puppet when first installing puppet.
  - debian/puppet.conf, lib/puppet/defaults.rb:
    + Move templates to /etc/puppet
  - lib/puppet/defaults.rb:
    + Fix /var/lib/puppet/state ownership.
  - man/man8/puppet.conf.8: 
    + Fix broken URL in manpage.
  - debian/control:
    + Update maintainer accordint to spec.
    + Puppetmaster Recommends -> Suggests
    + Created puppet-testsuite as a seperate. Allow the users to run puppet's 
      testsuite.
  - tests/Rakefile: Fix rakefile so that the testsuite can acutally be ran.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
        def evaluate(scope)
26
26
            title = @title.safeevaluate(scope)
27
27
            title = [title] unless title.is_a?(Array)
28
 
            
 
28
 
29
29
            if @type.to_s.downcase == "class"
30
30
                resource_type = "class"
31
31
                title = title.collect { |t| qualified_class(scope, t) }
43
43
        # Look up a fully qualified class name.
44
44
        def qualified_class(scope, title)
45
45
            # Look up the full path to the class
46
 
            if classobj = scope.findclass(title)
 
46
            if classobj = scope.find_hostclass(title)
47
47
                title = classobj.classname
48
48
            else
49
49
                raise Puppet::ParseError, "Could not find class %s" % title
56
56
            # We want a lower-case type.  For some reason.
57
57
            objtype = @type.downcase
58
58
            unless builtintype?(objtype)
59
 
                if dtype = scope.finddefine(objtype)
 
59
                if dtype = scope.find_definition(objtype)
60
60
                    objtype = dtype.classname
61
61
                else
62
62
                    raise Puppet::ParseError, "Could not find resource type %s" % objtype
64
64
            end
65
65
            return objtype
66
66
        end
 
67
 
 
68
        def to_s
 
69
            if title.is_a?(ASTArray)
 
70
                "#{type.to_s.capitalize}#{title}"
 
71
            else
 
72
                "#{type.to_s.capitalize}[#{title}]"
 
73
            end
 
74
        end
67
75
    end
68
76
end