Ok, this works great now but I've run into a different issue.

Previously, the 'setvar' method would set a replacement for the
'ipaddress' fact.

Unfortunately, this no longer works.

I've tried setting both 'ipaddress' and '::ipaddress' to no avail.

Any suggestions?

Once I figure all of this out, I'll post something online about it.

Thanks,

Trevor

On Tue, Mar 6, 2012 at 2:37 PM, Nick Lewis <[email protected]> wrote:
> On Tuesday, March 6, 2012 at 11:24 AM, Trevor Vaughan wrote:
>
> Hi Nick,
>
> Thanks for getting back to me.
>
> Unfortunately, this doesn't seem to be working for me.
>
> I tried:
>
> require 'rubygems'
> require 'puppet'
> require 'spec'
> require 'spec/mocks'
>
> env = Puppet::Node::Environment.new('nodename')
> Puppet::Parser::Functions::function(:mangle_ip_address)
> s = Puppet::Parser::Scope.new
> s.stub(:e).and_return env
>
> # Mask the ipaddress variable
> s.setvar('ipaddress','11.22.33.44')
> s.function_mangle_ip_address([])
>
> But unfortunately ended with the same result.
>
> I do figure that :e is not the correct procedure to stub, but I'm not
> sure which one is.
>
> Hah oops, I guess I shouldn't write emails in the morning. That should be
> stubbing the :environment method (which it will consult to get at
> known_resource_types).
>
> Nick
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.



-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
[email protected]

-- This account not approved for unencrypted proprietary information --

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to