Skip to content

FAILS_TESTS: New Feature Requerst #93

Closed
wants to merge 1 commit into from

4 participants

@andronat
andronat commented Aug 6, 2012

This is a try to solve #10166 feature request. It seams to work.
(https://projects.puppetlabs.com/issues/10166)

@andronat andronat #10166 New Feature Requerst
This is a try to solve this feature request. It seams to work.
23bc6aa
@optiz0r optiz0r added a commit to optiz0r/puppetlabs-firewall that referenced this pull request Dec 29, 2012
@optiz0r optiz0r Merge remote-tracking branch 'andronat/feature_request_#10166'
Merge upstream pull request #93, individually tuneable chain purges
ec44018
@phemmer phemmer commented on the diff Apr 8, 2013
lib/puppet/provider/firewall/iptables.rb
@@ -105,6 +108,9 @@ def self.instances
rules = []
counter = 1
+ # Get unmanaged chains and cache the result.
+ @@unmanaged_chains ||= unmanaged_chains_from_catalog
@phemmer
phemmer added a note Apr 8, 2013

On ruby 1.9.3 this gives the following warning:

/var/lib/puppet/lib/puppet/provider/firewall/iptables.rb:131: warning: class variable access from toplevel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@phemmer phemmer commented on the diff Apr 8, 2013
lib/puppet/provider/firewall/iptables.rb
@@ -197,6 +205,16 @@ def self.rule_to_hash(line, table, counter)
hash
end
+
+ # Get all chains that have 'managed' attribute equal to false.
+ def self.unmanaged_chains_from_catalog
+
+ # Get all chains from the current catalog.
+ chains = Puppet::Face[:catalog, :current].find(Puppet[:certname]).resources.select { |resource| resource.type =~ /Firewallchain/ }
@phemmer
phemmer added a note Apr 8, 2013

With puppet 3.0.1 this gives the following error:

Error: /Stage[main]//Resources[firewall]: Failed to generate additional resources using 'generate': uninitialized constant Puppet::Face
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@kbarber-jenkins-bot

Can one of the admins verify this patch?

@kbarber-jenkins-bot

Can one of the admins verify this patch?

@kbarber
Puppet member
kbarber commented Apr 19, 2013

The methodology in #114 I think is more backwards compatible then using the faces interface, weither its forwards compatible is a different question.

@kbarber-jenkins-bot

Can one of the admins verify this patch?

@kbarber
Puppet member
kbarber commented May 1, 2013

This methodology isn't quite right, and the patch is old so I'm closing it. See #114 for the ongoing discussion regarding this.

@kbarber kbarber closed this May 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.