projects
/
mirror
/
dsa-puppet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2fbbfd
)
refactor fact
author
Luca Filipozzi
<lfilipoz@emyr.net>
Wed, 16 May 2012 20:24:53 +0000
(20:24 +0000)
committer
Luca Filipozzi
<lfilipoz@emyr.net>
Wed, 16 May 2012 20:24:53 +0000
(20:24 +0000)
modules/debian-org/lib/facter/cluster.rb
patch
|
blob
|
history
diff --git
a/modules/debian-org/lib/facter/cluster.rb
b/modules/debian-org/lib/facter/cluster.rb
index
c6b00f6
..
f6bff1a
100644
(file)
--- a/
modules/debian-org/lib/facter/cluster.rb
+++ b/
modules/debian-org/lib/facter/cluster.rb
@@
-1,15
+1,15
@@
if FileTest.exist?('/usr/sbin/gnt-cluster')
if system('/usr/sbin/gnt-cluster getmaster >/dev/null')
require 'json'
- config = '/var/lib/ganeti/config.data'
+ json = JSON.parse(File.read('/var/lib/ganeti/config.data'))
Facter.add('cluster') do
setcode do
-
JSON.parse(File.read(config))
['cluster']['cluster_name']
+
json
['cluster']['cluster_name']
end
end
Facter.add('cluster_nodes') do
setcode do
- JSON.parse(File.read(config))['nodes'].keys
+ json['nodes'].keys.join(' ')
end
end
end