Sha256: 74d171c746948b064ba9e145e9675e64635003dae2a560c78db07d46a840e763
Contents?: true
Size: 796 Bytes
Versions: 15
Compression:
Stored size: 796 Bytes
Contents
require "log4r" #require 'vagrant' module VagrantPlugins module Skytap module Action # sets VM hostname via the API class SetHostname def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant_skytap::action::set_hostname") end def call(env) if hostname = env[:machine].config.vm.hostname if vm = env[:environment].current_vm if nic = vm.interfaces.first if hostname != nic.get_api_attribute('hostname') @logger.info("Updating hostname: #{hostname}") nic.update_with_retry(hostname: hostname) end end end end @app.call(env) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems