Class: VagrantPlugins::Utm::Action::SetId

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant_utm/action/set_id.rb

Overview

This action sets the machine id to the UUID of the VM in UTM.

Instance Method Summary collapse

Constructor Details

#initialize(app, _env) ⇒ SetId

Returns a new instance of SetId.



8
9
10
# File 'lib/vagrant_utm/action/set_id.rb', line 8

def initialize(app, _env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
# File 'lib/vagrant_utm/action/set_id.rb', line 12

def call(env)
  env[:machine].id = env[:machine].provider.driver.last_uuid
  env[:ui].info I18n.t("vagrant_utm.messages.setting_id", id: env[:machine].id)
  @app.call(env)
end