Further to the below, it looks like I appear to be getting differing 
behaviour in various environments :( 

TravisCI passes on Ruby 1.8.7 [1] but fails on Ruby 1.9.3 [2]. 
Running the tests on a local CentOS 6 box with RVM, I get failures with 
both versions of Ruby... So not sure why TravisCI can pass 1.8.7, but 
locally I cant :'(

Adding in some additional debug logging, I can see that 
'defined?(@resource[:dashost]' returns true with a 'method' response. 
However whenever I try and evaluate the value of 'resource[:dashost]', I 
get the 'Invalid parameter dashost(:dashost)' error.

Any ideas if it's possible to have 'optional' params that aren't defined on 
all types that use a provider?

Cheers
Gavin 

[1] https://travis-ci.org/fatmcgav/puppet-glassfish/jobs/24564901
[2] https://travis-ci.org/fatmcgav/puppet-glassfish/jobs/24564908

On Tuesday, 6 May 2014 17:40:09 UTC+1, Gavin Williams wrote:
>
> Afternoon all, 
>
> I'm trying to update my Glassfish module [1] to support some additional 
> functionality, such as clustering. 
>
> I've done most of the code changes, and they all seem to work fine from a 
> usage POV. However several of my tests [2] are failing with the following 
> error:
>   1) Puppet::Type::Application::ProviderAsadmin when asking exists? should 
> return true if resource is present
>      Failure/Error: application.provider.should be_exists
>      Puppet::Error:
>        Invalid parameter dashost(:dashost)
>      # ./lib/puppet/provider/asadmin.rb:6:in `asadmin_exec'
>      # ./lib/puppet/provider/application/asadmin.rb:22:in `exists?'
>      # ./spec/unit/puppet/provider/application/asadmin_spec.rb:34:in 
> `block (3 levels) in <top (required)>'
>
> I suspect this is related to some changes I made to 
> Puppet::Provider::Asadmin [3] in order to support running asadmin commands 
> against a host other than localhost. 
> Effectively, I'm just trying to only use the 'dashost' resource value if 
> it's defined and not null. 
> This works fine for actual usage, but seems to fail horribly for RSpec 
> testing :( 
>
> Cheers in advance for any replies. 
>
> Regards
> Gavin 
>
> [1] https://github.com/fatmcgav/puppet-glassfish/tree/develop
> [2] 
> https://travis-ci.org/fatmcgav/puppet-glassfish/jobs/24549377#L505-L511
> [3] 
> https://github.com/fatmcgav/puppet-glassfish/blob/develop/lib/puppet/provider/asadmin.rb#L6-L8
>

-- 
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 it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/51501d5b-65ea-49bb-9f8c-5879afdb4abf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to