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
Recursively validate puppet parameter values #107
Conversation
Hmm, it looks like 2.6.17 is automatically flattening arrays. This may just be old behavior; I could mark this testing as pending on 2.6.17. |
Yeah, 2.6 and below automatically flattened arrays for what i'm sure are hysterical raisins. |
Puppet internally stringifies all values, which means that rspec expectations with integers will fail because 1 != "1". This commit adds a new parameter class, which can recursively validate a parameter and ensure that structured data will be properly and recursively validated.
I've added special casing for 2.6 (https://github.com/rodjek/rspec-puppet/pull/107/files#L2R43) to ensure that integers are correctly validated even if there's array flattening. |
Recursively validate puppet parameter values
Love it, thanks! |
Thanks for the merge! |
Is there any chance this could be released? I have a couple of places where I'd like to test hash parameters (on ruby 1.8.7), but the version of rspec-puppet in RubyGems doesn't have this feature. Apologies if there is an easy work-around I'm not aware of -- and thanks for providing such a useful tool! |
+1, any Idea when this feature could be released ? |
@chqr @fcharlier If you're able to use Bundler for installing test dependencies you can pull this gem from git, like so: https://github.com/adrienthebo/puppet-network/blob/master/Gemfile#L19 |
Serving keystone from a wsgi container is recommended for production setups. SSL is enabled by default. See the following URLs for explanations: http://adam.younglogic.com/2012/03/keystone-should-move-to-apache-httpd/ https://etherpad.openstack.org/havana-keystone-performance Documentation in manifests/wsgi/apache.pp Apache can be configured as a drop in replacement for keystone (using ports 5000 & 35357) or with paths using the standard SSL port. See examples in examples/apache_*.pp - Also change some 'real_' prefix into '_real' suffix to respect the coding guide. - Added the '--insecure' option to keystone client in the provider to allow using self-signed certificates. - Fixed parsing the ssl/enable value in the provider. There is no integer verification done in the manifests and to get around a bug in rspec, which has been fixed in rodjek/rspec-puppet#107, certain parameters that should be integer are treated as strings files/httpd/keystone.py updated with lastest from keystone git repo Change-Id: Ide8c090d105c1ea75a14939f5e8ddb7d24ca3f1c
Serving keystone from a wsgi container is recommended for production setups. SSL is enabled by default. See the following URLs for explanations: http://adam.younglogic.com/2012/03/keystone-should-move-to-apache-httpd/ https://etherpad.openstack.org/havana-keystone-performance Documentation in manifests/wsgi/apache.pp Apache can be configured as a drop in replacement for keystone (using ports 5000 & 35357) or with paths using the standard SSL port. See examples in examples/apache_*.pp - Also change some 'real_' prefix into '_real' suffix to respect the coding guide. - Added the '--insecure' option to keystone client in the provider to allow using self-signed certificates. - Fixed parsing the ssl/enable value in the provider. There is no integer verification done in the manifests and to get around a bug in rspec, which has been fixed in rodjek/rspec-puppet#107, certain parameters that should be integer are treated as strings files/httpd/keystone.py updated with lastest from keystone git repo Change-Id: Ide8c090d105c1ea75a14939f5e8ddb7d24ca3f1c
Serving keystone from a wsgi container is recommended for production setups. SSL is enabled by default. See the following URLs for explanations: http://adam.younglogic.com/2012/03/keystone-should-move-to-apache-httpd/ https://etherpad.openstack.org/havana-keystone-performance Documentation in manifests/wsgi/apache.pp Apache can be configured as a drop in replacement for keystone (using ports 5000 & 35357) or with paths using the standard SSL port. See examples in examples/apache_*.pp - Also change some 'real_' prefix into '_real' suffix to respect the coding guide. - Added the '--insecure' option to keystone client in the provider to allow using self-signed certificates. - Fixed parsing the ssl/enable value in the provider. There is no integer verification done in the manifests and to get around a bug in rspec, which has been fixed in rodjek/rspec-puppet#107, certain parameters that should be integer are treated as strings files/httpd/keystone.py updated with lastest from keystone git repo Change-Id: Ide8c090d105c1ea75a14939f5e8ddb7d24ca3f1c Conflicts: examples/apache_dropin.pp examples/apache_with_paths.pp
Puppet internally stringifies all values, which means that rspec
expectations with integers will fail because 1 != "1". This commit adds
a new parameter class, which can recursively validate a parameter and
ensure that structured data will be properly and recursively validated.
This is the first time that I've written any non-trivial amount of code for RSpec, so I have no idea if this is the most idiomatic or clear approach. I would love feedback on how to make this better or more effective.