In regards to the prefetching the self.instance method of the Provider 
class I can use one call to provide at least half of the attributes I 
created for the type (add_device).  Obviously i did nto want this to be an 
expensive operation.  

I hacked together a ruby script that does pretty much everything in regards 
to device and class creation, modification and removal.  As i was learnign 
to put this together it dawned on me that there was no way i could reliably 
provide connection info without duplicating code for every provider and 
this i read Nans and Bodes threads and borrowed the code but have come 
unstuck when in a few places.  

The issue at the moment is getting access to the resource hash - from the 
provider.  Once thats solved Im almost on a home straight.

So how do i access the resource type.  Im using the provider type to test 
whether I can access it.  I am also running this without Puppet master.

In clues on how to access the resource hash 



On Wednesday, March 5, 2014 5:56:08 PM UTC, Shook Shivers wrote:
>
> I get Error: Could not prefetch zenoss_device provider 'zenoss_device': 
> undefined local variable or method `resource' for 
> Puppet::Type::Zenoss_device::ProviderZenoss_device:Class when using the 
> following 
>
> def self.prefetch(r)
>         @transport ||= 
> PuppetX::Puppetlabs::Transport.retrieve(:resource_ref => 
> resource[:transport], :catalog => resource.catalog, :provider => 'vsphere')
>
>     p "#{r}"
>   end
>
> The above is only for testing purposes
>
> Im writing a type provider for zenoss my first so please be kind and im 
> trying to access the  resource hash but cannot 
>
> All id like to know is what module (is it the provider) that will allow me 
> to access this resource hash
>
> I tried accessing it from within a provider but that does not work 
> "resource[:transport]".  
>
> Im using a usefull hack from https://github.com/vmware/vmware-vmware_libwhere 
> instead of using a SSH as a connector im using a Rest class i created 
> for connecting to a Zenoss master
>
> I guess the issue here is how do I use this transport type provider 
>
> Any clues anyone??
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/227ee452-4c09-4424-9d9d-54082db365a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to