~ubuntu-branches/ubuntu/oneiric/puppet/oneiric-security

« back to all changes in this revision

Viewing changes to lib/puppet/transportable.rb

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Pollock
  • Date: 2009-04-13 17:12:47 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (3.1.3 squeeze) (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20090413171247-61zlnwi5esw1lhtv
ImportĀ upstreamĀ versionĀ 0.24.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
                Puppet.debug "Defining %s on %s" % [param, ref]
54
54
                trans[param] = value
55
55
            }
 
56
            trans.catalog = self.catalog
56
57
            Puppet::Type::Component.create(trans)
57
58
        end
58
59
 
65
66
        end
66
67
 
67
68
        def to_manifest
68
 
            "#{self.type.to_s} { \'#{self.name}\':\n%s\n}" % @params.collect { |p, v|
69
 
                if v.is_a? Array
70
 
                    "    #{p} => [\'#{v.join("','")}\']"
71
 
                else
72
 
                    "    #{p} => \'#{v}\'"
73
 
                end
74
 
            }.join(",\n")
 
69
            "%s { '%s':\n%s\n}" % 
 
70
                [self.type.to_s, self.name,
 
71
                 @params.collect { |p, v|
 
72
                     if v.is_a? Array
 
73
                         "    #{p} => [\'#{v.join("','")}\']"
 
74
                     else
 
75
                         "    #{p} => \'#{v}\'"
 
76
                     end
 
77
                 }.join(",\n")
 
78
                ]
75
79
        end
76
80
 
77
81
        def to_yaml_properties