From 7c3b43e4623cbfcf5656f2e0b23bf4d7ea85021a Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 19 Jun 2012 19:56:21 +0200 Subject: [PATCH] Use yaml over json - yaml is in the default ruby --- modules/debian-org/lib/facter/cluster.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/debian-org/lib/facter/cluster.rb b/modules/debian-org/lib/facter/cluster.rb index dfff43680..fea14355f 100644 --- a/modules/debian-org/lib/facter/cluster.rb +++ b/modules/debian-org/lib/facter/cluster.rb @@ -1,16 +1,16 @@ if FileTest.exist?('/usr/sbin/gnt-cluster') and FileTest.exist?('/var/lib/ganeti/config.data') begin if system('/usr/sbin/gnt-cluster getmaster >/dev/null') - require 'json' - json = JSON.parse(File.read('/var/lib/ganeti/config.data')) + require 'yaml' + yaml = YAML.load_file('/var/lib/ganeti/config.data') Facter.add('cluster') do setcode do - json['cluster']['cluster_name'] + yaml['cluster']['cluster_name'] end end Facter.add('cluster_nodes') do setcode do - json['nodes'].keys.join(' ') + yaml['nodes'].keys.join(' ') end end end -- 2.20.1