Sha256: ae81998a79d5e4200b03be7a8bf81051d0db60a211bf90c041f748d553517dfa

Contents?: true

Size: 714 Bytes

Versions: 1

Compression:

Stored size: 714 Bytes

Contents

require 'uuid'
require "log4r"
require 'vagrant/util/retryable'

module VagrantPlugins
  module Smartos
    class Provider
      # This runs the configured instance.
      class ReloadInstance
        include Vagrant::Util::Retryable

        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant_smartos::action::reload_instance")
        end

        def call(env)
          vm_uuid = env[:machine].id

          if env[:machine].state.id != :not_created
            env[:ui].info(I18n.t("vagrant_smartos.reloading"))
            output = env[:hyp].exec("vmadm reboot #{vm_uuid}")
            env[:machine].id = nil
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-smartos-0.0.2pre1 lib/vagrant-smartos/action/reload_instance.rb