Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Dynamic Lookup of facter variable.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Douglas Garstang  
View profile  
 More options Aug 19 2012, 10:44 pm
From: Douglas Garstang <doug.garst...@gmail.com>
Date: Sun, 19 Aug 2012 19:44:28 -0700
Local: Sun, Aug 19 2012 10:44 pm
Subject: Dynamic Lookup of facter variable.
I don't get it...

    if ! ( $ec2_instance_type in [$ec2_inst_type_allow]) {
        notice("NOT ALLOWED")
    } else {
        notice("ALLOWED")
    }

2012-08-20T02:39:10.537134+00:00 truth puppet-master[24080]: Dynamic
lookup of $ec2_instance_type at /truth/sauce/env/prod/modules/rol
e/manifests/validate_server.pp:12 is deprecated.  Support will be
removed in Puppet 2.8.  Use a fully-qualified variable name (e.g., $
classname::variable) or parameterized classes.

Line 12 is the if statement. However, on the same client system...

[us1:i-16c5c050] root@testweb11:~# facter | grep ec2_instance_type
ec2_instance_type => m1.large

It's a facter variable. What's it complaining about?

Doug.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Shamow  
View profile   Translate to Translated (View Original)
 More options Aug 19 2012, 10:48 pm
From: Eric Shamow <e...@puppetlabs.com>
Date: Sun, 19 Aug 2012 22:48:21 -0400
Local: Sun, Aug 19 2012 10:48 pm
Subject: Re: [Puppet Users] Dynamic Lookup of facter variable.
Facts exist at top scope, as indicated in the scoping doc several people have referred you to on this list.  Use $::ec2_instance_type

Sent from my iPad

On Aug 19, 2012, at 10:44 PM, Douglas Garstang <doug.garst...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Douglas Garstang  
View profile  
 More options Aug 19 2012, 11:00 pm
From: Douglas Garstang <doug.garst...@gmail.com>
Date: Sun, 19 Aug 2012 20:00:49 -0700
Local: Sun, Aug 19 2012 11:00 pm
Subject: Re: [Puppet Users] Dynamic Lookup of facter variable.
Oh god that's ugly.

--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garst...@gmail.com
Cell: +1-805-340-5627


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nigel Kersten  
View profile  
 More options Aug 20 2012, 1:34 pm
From: Nigel Kersten <ni...@puppetlabs.com>
Date: Mon, 20 Aug 2012 10:34:19 -0700
Local: Mon, Aug 20 2012 1:34 pm
Subject: Re: [Puppet Users] Dynamic Lookup of facter variable.
On Sun, Aug 19, 2012 at 8:00 PM, Douglas Garstang

<doug.garst...@gmail.com> wrote:
> Oh god that's ugly.

Yes it is, and it was an unwitting bug with the deprecation warning
that is resolved in later versions.

Facts were supposed to be able to be referenced as $factname without
throwing the deprecation warning in your release, it's been fixed in
later versions.

--
Nigel Kersten | http://puppetlabs.com | @nigelkersten
Schedule Meetings at: http://tungle.me/nigelkersten

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Mooney  
View profile  
 More options Aug 20 2012, 4:33 pm
From: Tim Mooney <Tim.Moo...@ndsu.edu>
Date: Mon, 20 Aug 2012 15:33:20 -0500 (CDT)
Local: Mon, Aug 20 2012 4:33 pm
Subject: Re: [Puppet Users] Dynamic Lookup of facter variable.
In regard to: Re: [Puppet Users] Dynamic Lookup of facter variable., Nigel...:

> On Sun, Aug 19, 2012 at 8:00 PM, Douglas Garstang
> <doug.garst...@gmail.com> wrote:
>> Oh god that's ugly.

> Yes it is, and it was an unwitting bug with the deprecation warning
> that is resolved in later versions.

> Facts were supposed to be able to be referenced as $factname without
> throwing the deprecation warning in your release, it's been fixed in
> later versions.

Can you expound on this, Nigel?

Are you saying that we do *not* need to reference facts as $::factname
in all our classes, not even in preparation for puppet 3.x?  What if
we *are* referencing them that way, now?

Tim

--
Tim Mooney                                             Tim.Moo...@ndsu.edu
Enterprise Computing & Infrastructure                  701-231-1076 (Voice)
Room 242-J6, IACC Building                             701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nigel Kersten  
View profile   Translate to Translated (View Original)
 More options Aug 20 2012, 8:01 pm
From: Nigel Kersten <ni...@puppetlabs.com>
Date: Mon, 20 Aug 2012 17:01:49 -0700
Local: Mon, Aug 20 2012 8:01 pm
Subject: Re: [Puppet Users] Dynamic Lookup of facter variable.

There's no harm in going that extra mile and being explicit that
you're looking at a top scope variable fact, rather than a local
variable of the same name, so you can continue to reference them as
$::factname if you would like to do so.

Requiring that wasn't an original goal, as it was deemed too high a
cost for the most common case to force that rather ugly syntax on
everyone. It was a bug in the deprecation warning code.

Does that help?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Mooney  
View profile  
 More options Aug 21 2012, 12:50 am
From: Tim Mooney <Tim.Moo...@ndsu.edu>
Date: Mon, 20 Aug 2012 23:50:47 -0500 (CDT)
Local: Tues, Aug 21 2012 12:50 am
Subject: Re: [Puppet Users] Dynamic Lookup of facter variable.
In regard to: Re: [Puppet Users] Dynamic Lookup of facter variable., Nigel...:

It does help, thank you.

It's one of those things that I wish I had known before I spent hours
changing our modules in preparation for what I thought was going to
be a requirement for puppet 3.x, but better late than never.  :-)

I appreciate the clarity you've provided on this.

Tim
--
Tim Mooney                                             Tim.Moo...@ndsu.edu
Enterprise Computing & Infrastructure                  701-231-1076 (Voice)
Room 242-J6, IACC Building                             701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nigel Kersten  
View profile  
 More options Aug 21 2012, 12:40 pm
From: Nigel Kersten <ni...@puppetlabs.com>
Date: Tue, 21 Aug 2012 09:40:35 -0700
Local: Tues, Aug 21 2012 12:40 pm
Subject: Re: [Puppet Users] Dynamic Lookup of facter variable.

I do apologize for us messing up the deprecation warning.

It's caused a lot of unnecessary churn for everyone, and it's
frustrating for everyone involved :(


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Mooney  
View profile  
 More options Aug 21 2012, 12:51 pm
From: Tim Mooney <Tim.Moo...@ndsu.edu>
Date: Tue, 21 Aug 2012 11:51:23 -0500 (CDT)
Local: Tues, Aug 21 2012 12:51 pm
Subject: Re: [Puppet Users] Dynamic Lookup of facter variable.
In regard to: Re: [Puppet Users] Dynamic Lookup of facter variable., Nigel...:

>> It's one of those things that I wish I had known before I spent hours
>> changing our modules in preparation for what I thought was going to
>> be a requirement for puppet 3.x, but better late than never.  :-)

>> I appreciate the clarity you've provided on this.

> I do apologize for us messing up the deprecation warning.

> It's caused a lot of unnecessary churn for everyone, and it's
> frustrating for everyone involved :(

puppet's a moving target, and I think that most people that follow
the list understand that this kind of thing is going to happen on
occasion, especially when a major release is in the works.  I certainly
do.

The trick is going to be stamping out places where "you must top-scope
facts" may have already crept into documentation or people's puppet
idioms.

Tim
--
Tim Mooney                                             Tim.Moo...@ndsu.edu
Enterprise Computing & Infrastructure                  701-231-1076 (Voice)
Room 242-J6, IACC Building                             701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »