similar to: rspec-puppet: function stubs

Displaying 20 results from an estimated 10000 matches similar to: "rspec-puppet: function stubs"

2012 Oct 18
0
Puppet own function
Good day. Im trying to make my own function. I keep getting this message. err: Could not retrieve catalog from remote server: Error 400 on SERVER: Function ''brent_k'' does not return a value at /etc/puppet/modules/munin/manifests/init.pp:17 on node XYZ.com Here is my simple code xyz.com:/etc/puppet/modules/munin/lib/puppet/parser/functions# cat brent_k.rb module
2008 Aug 14
1
multiple functions in one file?
Hi there, just to be sure: http://reductivelabs.com/trac/puppet/wiki/WritingYourOwnFunctions says that "The file name is derived from the name of the function that Puppet is trying to run." Is this still true? I ask because I currently write a set of math functions (min,max, plus, minus and so). My first try was to create a math.rb, where I had: module Puppet::Parser::Functions
2013 Mar 07
1
HELP:Custom function didn't work
hi,guys- I have a mysql database which stores host informations,so I wrote a function to get some values. - Here is the function rb(this function should return the type I defined in the database): #hosttype.rb require "mysql" module Puppet::Parser::Functions newfunction(:hosttype, :type => :rvalue, :doc => "Gets host type from db.") do |args|
2009 Jan 02
2
problem with custom funcion
Hello! I''ve written custom function split - it''s located in modules/common/ plugins/puppet/parser/functions/split.rb and contains: module Puppet::Parser::Functions newfunction(:split, :type => :rvalue) do |args| str=args[0] regex=args[1] idx=args[2] out=str.split(/#{regex}/) if out.is_a? Array out[idx] else "" end
2009 Nov 25
1
Puppet custom functions and user permissions
Puppet custom functions and user permissions I am busy writing a custom function to automatically add OSSEC agents to a OSSEC server after installation. Unfortunately, it seems that puppetmasterd is not respecting the entries in /etc/group in linux. No matter how many other groups the puppet user has been added to in /etc/ group, when puppetmasterd runs the custom function the effective/real user
2013 Feb 03
3
Another "function does not return a value" problem
Here''s the function: module Puppet::Parser::Functions newfunction(:fact_to_array, :type => :rvalue) do |args| args[0].split('','') end end Here''s the class I''m trying to use it in: class oms::all_config { file { ''/var/lib/oms/config'': source => ''puppet:///deployment/deployment'', recurse =>
2007 Jun 06
2
lookup in CSV recipe
I await Luke''s node settings implementation with interest. At the moment however, I have this sort of ugliness: $site = $hostname ? { fred => "opsera", barney => "bedrock", default => "unknown site", ... } So I''ve knocked up this little function to use CSV files instead. Now I can just do: $site =
2011 May 19
2
custom function from .24.6 not working in 2.6 (from squeeze)
I''m in the process of upgrading an existing installation from .24.x to 2.6. We seem to have a custom function that is throwing the error: "err: Could not retrieve catalog from remote server: Error 400 on SERVER: private method `gsub'' called for #<Array:0x7fdcebf3bbf8> at /etc/puppet/manifests/classes/apache-php.pp:72" Here is the function: """ #
2013 Oct 21
3
how to pass the value to custom function?
Dear all, I''m trying this thing for a while but can''t figure out what am I doing wrong. Here is my sample function (which is similar to the original one, except for the hash, which is generated dynamically in the original one): module Puppet::Parser::Functions > newfunction(:am_running_oss, :type => :rvalue ) do |args| > > oss =
2013 Oct 10
0
RSpec-testing an entire puppet master
Has anyone ever written rspec-puppet-based code to check an entire site, i.e. looping over all node names - with proper facts - to verify that the catalog for each node is OK? I haven''t seen any examples of this. /P -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from
2012 Feb 22
4
Custom function issue
Hi, I needed a function to check if a file is existing on the Debian box I am configuring. So I used this one module Puppet::Parser::Functions newfunction(:file_exists, :type => :rvalue) do |args| if File.exists?(args[0]) return 1 else return 0 end end end It work greats for some service where apache2 doesn''t work for me. I am using it this way
2008 May 02
4
Functions vs. Module Plugins vs. Facts
Hey all, I am trying to get a modified hostname (converting "blah-1234567" to "1234567") to use in my manifests and templates. I have it working for templates by using Ruby (*<%= hostname.split(''-'').pop.downcase %>*) but I haven''t been able to use it in manifests because they don''t process ERB. The way I see it I could do one of two
2010 Jul 01
1
using rSpec stub in Cucumber with rSpec2
Hello, I have a Rails3beta4 project where I want to use rSpec stubs in a Cucumber feature. Unfortunately it looks like requiring ''spec/stubs/cucumber'' in env.rb does not work anymore: I get a "no such file to load -- spec/stubs/cucumber (LoadError)" error. Is it possible to use rSpec stubs in Cucumber with rSpec2? If not, is there any other viable alternative? Thanks
2009 Jan 27
2
[RSpec] Error when returning multiple values from a stub
Hey guys. I''ve just found some odd behaviour within RSpec 1.1.12 , and would like to know whether this is a bug, or I''m doing something wrong. When I give multiple return values to a stub, like this: SubtitleFile.stub!(:new).and_return @sf1, @sf2 RSpec complains: Mock ''SubtitleFile_1001'' received unexpected message :size with (no args) However, if I
2012 Jul 18
2
rspec-puppet and puppet doc conflicts
I recently started trying to use rspec-puppet and puppetlabs-rspec-helper. When I ran ''rspec-puppet-init'' in one o fmy modules, it created a series of symlinks. Now, when I run puppet doc (via a rake task supplied by The Foreman, but also when I call it directly) I get the following error: Could not generate documentation: Definition ''mongodb::addmongouser''
2012 Aug 15
1
rspec-puppet and exported resources
Hi, Is there a way to test for exported resources using rspec-puppet ? I found a post explaining how it could be done with cucumber ( http://blog.nistu.de/2011/09/04/testing-exported-resources-with-cucumber-puppet ) but could not find examples or documentation for rspec-puppet. Cheers -- You received this message because you are subscribed to the Google Groups "Puppet Users"
2012 Dec 17
3
Rspec with rspec-hiera-puppet
I''ve been working on getting spec tests on all of my modules and am down to ones that use hiera and don''t have any reasonable defaults. It looks like there is a project on GH (https://github.com/amfranz/rspec-hiera-puppet) that is designed to fill this need, but for the life of me I cannot make it work. FriedBob helped out on the IRC channel some with his solution of including
2010 Jul 13
2
[Rspec] Difference between stub and message expectation with any_number_of_times
I''m wondering what''s the difference between stub and message expectation with any_number_of_times, for example: myMock = mock("mymock") myMock.stub!(:is_a?).with(MyClass).and_return(false) and myMock = mock("mymock") myMock.should_receive(:is_a?).with(MyClass).any_number_of_times.and_return(false) because is_a? may not be called at all, it just like a
2012 Jul 20
2
rspec-puppet and create_resources
Using rspec-puppet should I be able to check for resources created as a result of a create_resources call within a class? Regards, Mark -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/bUD_CitDYCAJ. To post to this group, send email to
2012 Aug 17
3
puppet-rspec / puppetlabs_spec_helper
I am using puppet 2.7.14 on Ubuntu 10.04 LTS. I have the following gems: *** LOCAL GEMS *** diff-lcs (1.1.3) hiera (0.3.0) hiera-puppet (0.3.0) metaclass (0.0.1) mocha (0.12.1) puppet-lint (0.1.13) puppetlabs_spec_helper (0.2.0) rake (0.9.2.2) rspec (2.11.0) rspec-core (2.11.1) rspec-expectations (2.11.2) rspec-mocks (2.11.1) rspec-puppet (0.1.3) When I run "rake help" I get the