Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/facter/gluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
gluster_volumes = {}
peer_count = 0
peer_list = ''
peer_list_ar = []
volume_options = {}
volume_ports = {}

Expand Down Expand Up @@ -50,9 +51,14 @@
gluster_peers[peer]['status'] = peer_xml.elements['stateStr'].text.to_s
end

# Collecting all hostnames of peers
REXML::XPath.match(peer_status_xml, '/cliOutput/peerStatus/peer/hostnames/hostname').each do |hn|
peer_list_ar.append(hn.to_a)
end

# Extract and format the data needed for the legacy peer facts.
peer_count = gluster_peers.size
peer_list = gluster_peers.keys.join(',')
peer_list = peer_list_ar.join(',')

# Get our volume information from gluster volume info
volume_info_xml = REXML::Document.new(Facter::Util::Resolution.exec("#{binary} volume info --xml"))
Expand Down