Issue #16903 has been updated by Andrew  Parker.

IRC conversation about this issue (snipped out parts not relevant).

<pre>
[2012/10/09 20:11:01] <zaphod42> s0lar: so you are writing a perl script that 
feeds the data into your inventory system? Why does the data need to be XML if 
you are writing the script?
[2012/10/09 20:11:10] <s0lar> zaphod42: not sure how to do the pull request
[2012/10/09 20:12:01] <s0lar> zaphod42: well, i'm not writing the perl script 
myself.. its another application that needs XML as input
[2012/10/09 20:12:18] <zaphod42> s0lar: 
https://help.github.com/articles/creating-a-pull-request
[2012/10/09 20:12:39] <s0lar> zaphod42: we're going to put them all on an ftp, 
to use for asset managemetn
[2012/10/09 20:12:46] <s0lar> thx
[2012/10/09 20:12:50] <zaphod42> s0lar: and it is this specific format of XML 
that you need?
[2012/10/09 20:14:11] <s0lar> zaphod42: their requirements just said XML, but I 
guess it could be formatted differently.. its just a plain convert
[2012/10/09 20:14:29] <s0lar> using some schema
[2012/10/09 20:15:22] <s0lar> zaphod42: open to ideas for improvement :)
[2012/10/09 20:16:50] <zaphod42> s0lar: it seems to me that since this is going 
to be an internal format for some other team getting inventory data you might 
want to have more control over it
[2012/10/09 20:17:28] <zaphod42> s0lar: in which case you write something just 
like that perl script, but that slurps in the facter YAML output and outputs 
the XML that is needed
[2012/10/09 20:17:45] <zaphod42> s0lar: which might simply by the SimplXML 
module's default output
[2012/10/09 20:18:17] <zaphod42> s/by/be/
[2012/10/09 20:18:48] <s0lar> zaphod42: I guess, I that could be done instead..
[2012/10/09 20:18:56] <s0lar> -I
[2012/10/09 20:19:05] <s0lar> hmm
[2012/10/09 20:21:59] <s0lar> zaphod42: however, XML output could be useful 
without writing another parser :)
[2012/10/09 20:22:15] <s0lar> I'll talk to the developer tomorrow
[2012/10/09 20:22:59] <s0lar> before submitting the pull request
[2012/10/09 20:23:12] <zaphod42> s0lar: XML output might be nice, but it also 
opens a whole can of worms of how should facter represent its facts in XML. 
YAML and JSON are both pretty clear. XML however doesn't have any native way of 
doing dictionaries or lists
[2012/10/09 20:24:03] <zaphod42> s0lar: cool. Think it over. I really think 
that in the long run having control over the format might be better for you. 
Especially if you ever want to include something that isn't part of facter.
[2012/10/09 20:25:42] <s0lar> zaphod42: I could do it by using perl JSON and 
feed it into perl SimpleXML , that way formatting it as they want perhaps
[2012/10/09 20:26:01] <zaphod42> s0lar: yep, that is what I was thinking
[2012/10/09 20:26:15] <s0lar> I mean getting facter --json > xxxx.json , then 
perl json < xxxx
[2012/10/09 20:26:20] <s0lar> ok
[2012/10/09 20:26:42] <zaphod42> s0lar: or even just facter --json | perl json
</pre>

I would prefer that we don't have this XML output in facter, or if we do, then 
we should put some thought into the schema and not simply take the default 
format of SimpleXml.
----------------------------------------
Feature #16903: Add support to output as XML
https://projects.puppetlabs.com/issues/16903#change-73180

Author: Magnus Forsberg
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Keywords: 
Branch: 2.x
Affected Facter version: 


Add support to Facter to output facts as XML:

# facter kernel kernelmajversion --xml
<opt kernel="Linux" kernelmajversion="3.1" />

# facter kernel uptime -x
<opt uptime="1 day" kernel="Linux" />


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to