Class: VagrantPlugins::ProviderVeertu::Action::SaneDefaults

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-veertu/action/sane_defaults.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ SaneDefaults

Returns a new instance of SaneDefaults.



7
8
9
10
# File 'lib/vagrant-veertu/action/sane_defaults.rb', line 7

def initialize(app, env)
  @logger = Log4r::Logger.new("vagrant::action::vm::sanedefaults")
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/vagrant-veertu/action/sane_defaults.rb', line 12

def call(env)
  # Set the env on an instance variable so we can access it in
  # helpers.
  @env = env

  # Use rtcuseutc so that the VM sees UTC time.
  #command = ["modifyvm", env[:machine].id, "--rtcuseutc", "on"]
  #attempt_and_log(command, "Enabling rtcuseutc...")

  if env[:machine].provider_config.auto_nat_dns_proxy
    @logger.info("Automatically figuring out whether to enable/disable NAT DNS proxy...")

    # Enable/disable the NAT DNS proxy as necessary
    #if enable_dns_proxy?
    #  #command = ["modifyvm", env[:machine].id, "--natdnsproxy1", "on"]
    #  #attempt_and_log(command, "Enable the NAT DNS proxy on adapter 1...")
    #else
    #  command = ["modifyvm", env[:machine].id, "--natdnsproxy1", "off" ]
    #  attempt_and_log(command, "Disable the NAT DNS proxy on adapter 1...")
    #  command = ["modifyvm", env[:machine].id, "--natdnshostresolver1", "off" ]
    #  attempt_and_log(command, "Disable the NAT DNS resolver on adapter 1...")
    #end
  else
    @logger.info("NOT trying to automatically manage NAT DNS proxy.")
  end

  @app.call(env)
end