fix munin 1
[mirror/dsa-puppet.git] / modules / debian-org / lib / facter / cluster.rb
index c8a2ac4..46d0bec 100644 (file)
@@ -1,16 +1,14 @@
-if FileTest.exist?('/usr/sbin/gnt-cluster') and FileTest.exist?('/var/lib/ganeti/config.data')
+if FileTest.exist?('/usr/sbin/gnt-cluster') and FileTest.exist?('/var/lib/ganeti/ssconf_cluster_name')
        begin
                if system('/usr/sbin/gnt-cluster getmaster >/dev/null')
-                       require 'yaml'
-                       yaml = YAML.load_file('/var/lib/ganeti/config.data')
                        Facter.add('cluster') do
                                setcode do
-                                       yaml['cluster']['cluster_name']
+                                       open('/var/lib/ganeti/ssconf_cluster_name').read().chomp()
                                end
-                               end
-                               Facter.add('cluster_nodes') do
+                       end
+                       Facter.add('cluster_nodes') do
                                setcode do
-                                       yaml['nodes']['name'].keys.join(' ')
+                                       open('/var/lib/ganeti/ssconf_node_list').read().split().join(" ")
                                end
                        end
                end