* Richard Crowley <r at rcrowley.org> [2010/10/22 08:57]:
> > We're writing a few scripts at the moment that could really make
> > use of Facter, however the vast majority of them team (including
> > my self!) are not proficient in Ruby, however they are highly
> > proficient in other languages such as (dare I say it!) Python.
>
> Many of the facts already fork so wiring in the command-line
> facter tool might not be a bad idea and is certainly possible
> right now.
I was thinking that, too:
import os
facts = {}
for fact in os.popen("facter").readlines():
n, v = fact.split(" => ")
facts[ n ] = v.rstrip()
That gives you the facts as a dictionary.
--
If not for coffee, I'd have no use for water at all.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" 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-users?hl=en.