Class: VagrantPlugins::Proxmox::Action::GetNodeList

Inherits:
ProxmoxAction
  • Object
show all
Defined in:
lib/vagrant-proxmox/action/get_node_list.rb

Overview

This action gets a list of all the nodes e.g. [‘node1’, ‘node2’] of a Proxmox server cluster and stores it under env

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ GetNodeList

Returns a new instance of GetNodeList.



9
10
11
# File 'lib/vagrant-proxmox/action/get_node_list.rb', line 9

def initialize app, env
	@app = app
end

Instance Method Details

#call(env) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/vagrant-proxmox/action/get_node_list.rb', line 13

def call env
	begin
		env[:proxmox_nodes] = env[:proxmox_connection].get_node_list
		next_action env
	rescue => e
		raise Errors::CommunicationError, error_msg: e.message
	end
end