Skip to content

Commit 517703d

Browse files
author
Wouter D'Haeseleer
committed
Including other names in the preer probe fact
When having multiple interfaces on a gluster cluster. It is now possible to probe each interface and facter will return the other names as well. Otherwise fater will probe each run Fixes #124
1 parent 590d83d commit 517703d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/facter/gluster.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
peer_count = Regexp.last_match[1].to_i if output =~ %r{^Number of Peers: (\d+)$}
3030
if peer_count > 0
3131
peer_list = output.scan(%r{^Hostname: (.+)$}).flatten.join(',')
32+
other_names = output.scan(%r{^Other names:\n((.+\n)+)}).flatten.join.scan(%r{(.+)\n?}).sort.uniq.flatten.join(',')
33+
if other_names
34+
peer_list += ',' + other_names
35+
end
3236
# note the stderr redirection here
3337
# `gluster volume list` spits to stderr :(
3438
output = Facter::Util::Resolution.exec("#{binary} volume list 2>&1")

0 commit comments

Comments
 (0)