Class: VagrantPlugins::Proxmox::Action::UploadTemplateFile

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

Overview

This action uploads a template file into the local storage of a given node

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ UploadTemplateFile

Returns a new instance of UploadTemplateFile.



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

def initialize app, env
	@app = app
	@logger = Log4r::Logger.new 'vagrant_proxmox::action::template_file_upload'
end

Instance Method Details

#call(env) ⇒ Object



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

def call env
	env[:result] = :ok
	config = env[:machine].provider_config
	if config.openvz_template_file
		env[:result] = upload_file env, config.openvz_template_file, config.replace_openvz_template_file
	end
	next_action env
end