Sha256: 4af4eba1777c4fc8793b6d43afbee4a01fca51f95e6d2f180feeb875668b0ac3

Contents?: true

Size: 605 Bytes

Versions: 9

Compression:

Stored size: 605 Bytes

Contents

module VagrantPlugins
  module Openstack
    module Action
      class Suspend
        def initialize(app, _env)
          @app = app
          @logger = Log4r::Logger.new('vagrant_openstack::action::suspend_server')
        end

        def call(env)
          if env[:machine].id
            @logger.info "Saving VM #{env[:machine].id} state and suspending execution..."
            env[:ui].info I18n.t('vagrant.actions.vm.suspend.suspending')
            env[:openstack_client].nova.suspend_server(env, env[:machine].id)
          end

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vagrant-openstack-provider-0.5.2 lib/vagrant-openstack-provider/action/suspend.rb
vagrant-openstack-provider-0.5.1 lib/vagrant-openstack-provider/action/suspend.rb
vagrant-openstack-provider-0.5.0 lib/vagrant-openstack-provider/action/suspend.rb
vagrant-openstack-provider-0.4.1 lib/vagrant-openstack-provider/action/suspend.rb
vagrant-openstack-provider-0.4.0 lib/vagrant-openstack-provider/action/suspend.rb
vagrant-openstack-provider-0.3.4.pre lib/vagrant-openstack-provider/action/suspend.rb
vagrant-openstack-provider-0.3.3 lib/vagrant-openstack-provider/action/suspend.rb
vagrant-openstack-provider-0.3.2 lib/vagrant-openstack-provider/action/suspend.rb
vagrant-openstack-provider-0.3.0 lib/vagrant-openstack-provider/action/suspend.rb