Sha256: 4b8f29843d456cd1935ec2396768b09516c2faf03c7a0b383ea5bbc005359024

Contents?: true

Size: 1.24 KB

Versions: 6

Compression:

Stored size: 1.24 KB

Contents

class Puppet::Type

    # this is a retarded hack method to get around the difference between
    # component children and file children
    def self.depthfirst?
        if defined? @depthfirst
            return @depthfirst
        else
            return false
        end
    end
    
    def depthfirst?
        self.class.depthfirst?
    end

    # Add a hook for testing for recursion.
    def parentof?(child)
        if (self == child)
            debug "parent is equal to child"
            return true
        elsif defined? @parent and @parent.parentof?(child)
            debug "My parent is parent of child"
            return true
        else
            return false
        end
    end

    # Remove an object.  The argument determines whether the object's
    # subscriptions get eliminated, too.
    def remove(rmdeps = true)
        # This is hackish (mmm, cut and paste), but it works for now, and it's
        # better than warnings.
        @parameters.each do |name, obj|
            obj.remove
        end
        @parameters.clear
        self.class.delete(self)

        @parent = nil

        # Remove the reference to the provider.
        if self.provider
            @provider.clear
            @provider = nil
        end
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-0.24.0 lib/puppet/metatype/container.rb
puppet-0.24.2 lib/puppet/metatype/container.rb
puppet-0.24.4 lib/puppet/metatype/container.rb
puppet-0.24.1 lib/puppet/metatype/container.rb
puppet-0.24.3 lib/puppet/metatype/container.rb
puppet-0.24.5 lib/puppet/metatype/container.rb