Sha256: 6e616a7cbf1fb04c3acf06df96943225c26d6b0e6d9f2298c352a3d5ff5cf789
Contents?: true
Size: 1.12 KB
Versions: 15
Compression:
Stored size: 1.12 KB
Contents
require "log4r" #require 'vagrant' require 'vagrant-skytap/api/vm' module VagrantPlugins module Skytap module Action # This action reads the SSH info for the machine and puts it into the # `:machine_ssh_info` key in the environment. class UpdateHardware def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant_skytap::action::update_hardware") end def call(env) if vm = env[:environment].current_vm provider_config = vm.machine.provider_config hardware_info = { cpus: provider_config.cpus, cpus_per_socket: provider_config.cpuspersocket, ram: provider_config.ram, guestOS: provider_config.guestos, }.reject{|k, v| v.nil? || v == vm.hardware[k.to_s]} if hardware_info.present? @logger.info("Updating hardware properties: #{hardware_info}") vm.update_with_retry(hardware: hardware_info) end end @app.call(env) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems