Method: Top#update_nodes

Defined in:
lib/ls4/command/top.rb

#update_nodesObject



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/ls4/command/top.rb', line 196

def update_nodes
	s = $net.get_session(*@cs_addr)
	s.timeout = 20

	fault_nids = s.call(:stat, 'fault')
	s.call(:stat, 'nodes').each {|nid,address,name,rsids,location|
		address = MessagePack::RPC::Address.load(address)
		fault = fault_nids.include?(nid)
		if node = @nodes[nid]
			node.update_info(address, name, rsids, location, fault)
		else
			@nodes[nid] = TargetNode.new(nid, address, name, rsids, location, fault)
		end
	}
	@nodes_sorted = @nodes.values.sort_by {|node| node.nid }
end