-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modules 1192 - rename facts param on actionpolicy::rule to remove conflict with $facts hash #161
Conversation
Ok, I'll need to revisit this and figure out why travis is so horribly angry, and so vastly different from my local spec runs... probably won't be able to get to it until this evening or tomorrow. |
Ok, I've gotten this to the point that the only specs failing are the two for the 3.0.0 Puppet gem, because of "Invalid resource type anchor" - it looks to me that this has been happening for a while? |
@@ -3,7 +3,7 @@ source 'https://rubygems.org' | |||
|
|||
group :development, :test do | |||
gem 'rake' | |||
gem 'puppetlabs_spec_helper', :require => false | |||
gem 'puppetlabs_spec_helper', :git => 'https://github.com/puppetlabs/puppetlabs_spec_helper.git', :branch => 'master', :require => false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I was going to release this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Released as 0.7.0
fixed the gemfile puppetlabs_spec_helper thing |
Ok, the rebase wasn't actually that bad at all, it looks like the only conflicts were in .travis.yml and Gemfile. It was a bit of a pain, but not too time consuming. |
@hunner do you remember why this is still just sitting here? I honestly don't remember... was I supposed to do something? |
@hunner ping again - is this waiting on me? |
Rebase on master and solve merge conflicts in |
@jantman just a friendly FYI in case you missed my comment on the MODULES-1192 ticket you need to update the actionpolicy.erb as well: diff --git a/modules/mcollective/templates/actionpolicy.erb b/modules/mcollective/templates/actionpolicy.erb
index 893859d..0950e75 100644
--- a/modules/mcollective/templates/actionpolicy.erb
+++ b/modules/mcollective/templates/actionpolicy.erb
@@ -1,7 +1,7 @@
policy default <%= @data['default'] %>
<%
lines = @data['lines'].collect do |line|
- line.values_at(*%w{ action callerid actions facts classes }).join("\t")
+ line.values_at(*%w{ action callerid actions fact_filter classes }).join("\t")
end
-%>
<%= lines.sort.join("\n") %> |
…parameter conflicting with $facts hash when trusted_node_data=true - add travis matrix builds for puppet 3.7.0, with and without trusted_node_data=true - rename mcollective::actionpolicy::rule 'facts' parameter to 'fact_filter', to not conflict with $facts hash from trusted_node_data=true - require puppetlabs_spec_helper >= 0.7.0 for TRUSTED_NODE_DATA env variable - add actionpolicy::rule spec, along with test for specified facts param - update templates/actionpolicy.erb
Thanks, @mojomax I'd missed that comment. Fix made, pushed up, testing now. |
Any news on getting this merged? |
@duritong thanks for the bump. |
@@ -1,7 +1,7 @@ | |||
policy default <%= @data['default'] %> | |||
<% | |||
lines = @data['lines'].collect do |line| | |||
line.values_at(*%w{ action callerid actions facts classes }).join("\t") | |||
line.values_at(*%w{ action callerid actions fact_filter classes }).join("\t") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary, because the hash still has the key facts:
https://github.com/puppet-community/puppet-mcollective/pull/161/files#diff-26b416a07573e48cd8576ce727abff8aL18
You break the policy file with that change
I can look at this again if nobody else wants to pick it up, but to be honest, it's been so long since I've touched this that I barely remember these portions of code... |
I added #209, which is a rebased & fixed PR |
Closing this in favor of #209. Hashtag: Housekeeping. |
The gist of MODULES-1192 is that
trusted_node_data=true
is now (3.6) a "recommended and safe" puppet config setting; this enables the$facts
hash, which makes$facts
a reserved variable and thereforemcollective::actionpolicy::rule
generates a compile-time failure.This branch will probably need some fixup by me, but I've included my intermediate work in order to fully test and convey what I've done:
trusted_node_data
mcollective::actionpolicy::rule
define, which was previously untested. Add one that uses the facts parameter.mcollective::actionpolicy::rule
from "facts" to "fact_filter" (this is the actual MODULES-1192 work). I've updated the README appropriately for the new param, but I'm not sure what the correct place is to document essentially a breaking change (side note on this - as I mentioned in the Jira ticket, I was unable to find a single piece of public code that uses this param).