Sha256: 4b36486224114300921ace95504996a86098f7dc8bafc7136828a29739911475

Contents?: true

Size: 614 Bytes

Versions: 4

Compression:

Stored size: 614 Bytes

Contents

require "log4r"

module VagrantPlugins
  module OpenStack
    module Action
      # This starts a suspended server, if there is one.
      class ResumeServer
        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant_openstack::action::resume_server")
        end

        def call(env)
          if env[:machine].id
            env[:ui].info(I18n.t("vagrant_openstack.resuming_server"))
            server = env[:openstack_compute].servers.get(env[:machine].id)
            server.resume
          end

          @app.call(env)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vagrant-openstack-plugin-0.6.1 lib/vagrant-openstack-plugin/action/resume_server.rb
vagrant-openstack-plugin-0.6.0 lib/vagrant-openstack-plugin/action/resume_server.rb
vagrant-openstack-plugin-0.5.0 lib/vagrant-openstack-plugin/action/resume_server.rb
vagrant-openstack-plugin-0.4.1 lib/vagrant-openstack-plugin/action/resume_server.rb