lib/corosync/votequorum.rb
# Get the votequorum info about a node.
# The return openstruct will contain the following keys
#   * node_id - Integer
#   * node_state - Symbol: :member or :dead or :leaving
#   * node_votes - Integer
#   * node_expected_votes - Integer
#   * highest_expected - Integer
#   * total_votes - Integer
#   * quorum - Integer
#   * flags - Array<Symbol> where each symbol is one of: :twonode, :quorate, :wait_for_all, :last_man_standing, :auto_tie_breaker, :allow_downscale, :qdevice_registered, :qdevice_alive, :qdevice_cast_vote, or :qdevice_master_wins
#   * qdevice_votes - Integer
#   * qdevice_name - String
# @param node_id [Integer] The node id to look up. 0 for the current node.
# @return [OpenStruct]
Get the votequorum info about a node.
Get the votequorum info about a node .
def info(node_id = 0)
		info = Corosync::VotequorumInfo.new
		Corosync.cs_send(:votequorum_getinfo, @handle, node_id, info)
		info = OpenStruct.new(Hash[info.members.zip(info.values)])
		info.qdevice_name = info.qdevice_name.to_s
		flags = info.flags
		info.flags = []
		[:twonode,:quorate,:wait_for_all,:last_man_standing,:auto_tie_breaker,:allow_downscale,:qdevice_registered,:qdevice_alive,:qdevice_cast_vote,:qdevice_master_wins].each do |flag_name|
			flag_value = Corosync.const_get("VOTEQUORUM_INFO_#{flag_name.to_s.upcase}")
			info.flags << flag_name if flags & flag_value >= 1
		end
		info
	end
def info ( node_id = 0 ) info = Corosync :: VotequorumInfo . new Corosync . cs_send ( :votequorum_getinfo , @handle , node_id , info ) info = OpenStruct . new ( Hash [ info . members . zip ( info . values ) ] ) info . qdevice_name = info . qdevice_name . to_s flags = info . flags info . flags = [ ] [ :twonode , :quorate , :wait_for_all , :last_man_standing , :auto_tie_breaker , :allow_downscale , :qdevice_registered , :qdevice_alive , :qdevice_cast_vote , :qdevice_master_wins ] . each do | flag_name | flag_value = Corosync . const_get ( "VOTEQUORUM_INFO_#{flag_name.to_s.upcase}" ) info . flags << flag_name if flags & flag_value >= 1 end info end
Get the votequorum info about a node.
Get the votequorum info about a node .
#Corosync::Votequorum::Info.new info
None
OpenStruct
node_id
The node id to look up. 0 for the current node.
The node id to look up . 0 for the current node .