Sha256: ad0b2169f64542a430cc9d5128d80066d4e91607bec7785aaa0d323fa3b0e519

Contents?: true

Size: 1.01 KB

Versions: 20

Compression:

Stored size: 1.01 KB

Contents

class Puppet::Provider::Firewall < Puppet::Provider

  # Prefetch our rule list. This is ran once every time before any other
  # action (besides initialization of each object).
  def self.prefetch(resources)
    debug("[prefetch(resources)]")
    instances.each do |prov|
      if resource = resources[prov.name] || resources[prov.name.downcase]
        resource.provider = prov
      end
    end
  end

  # Look up the current status. This allows us to conventiently look up
  # existing status with properties[:foo].
  def properties
    if @property_hash.empty?
      @property_hash = query || {:ensure => :absent}
      @property_hash[:ensure] = :absent if @property_hash.empty?
    end
    @property_hash.dup
  end

  # Pull the current state of the list from the full list.  We're
  # getting some double entendre here....
  def query
    self.class.instances.each do |instance|
      if instance.name == self.name or instance.name.downcase == self.name
        return instance.properties
      end
    end
    nil
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
freighthop-0.6.1 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.6.0 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.5.2 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.5.1 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.5.0 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.4.1 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.4.0 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.3.3 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.3.2 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.3.1 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.3.0 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.2.1 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.2.0 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.1.0 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.0.6 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.0.5 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.0.4 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.0.3 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.0.2 modules/firewall/lib/puppet/provider/firewall.rb
freighthop-0.0.1 modules/firewall/lib/puppet/provider/firewall.rb