Sha256: 8798ac6d7185e1fe9b6f1d72a811680e27b5968756d012a2131715ca239e284e

Contents?: true

Size: 701 Bytes

Versions: 9

Compression:

Stored size: 701 Bytes

Contents

require "log4r"

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

        def call(env)
          if env[:machine].id
            env[:ui].info(I18n.t("vagrant_openstack.rebooting_server"))

            # TODO: Validate the fact that we get a server back from the API.
            server = env[:openstack_compute].servers.get(env[:machine].id)
            server.reboot('SOFT')
          end

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

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
vagrant-openstack-plugin-tom-0.12.0 lib/vagrant-openstack-plugin/action/reboot_server.rb
vagrant-openstack-plugin-0.12.0 lib/vagrant-openstack-plugin/action/reboot_server.rb
vagrant-openstack-plugin-0.11.1 lib/vagrant-openstack-plugin/action/reboot_server.rb
vagrant-openstack-plugin-0.11.0 lib/vagrant-openstack-plugin/action/reboot_server.rb
vagrant-openstack-plugin-0.10.0 lib/vagrant-openstack-plugin/action/reboot_server.rb
vagrant-openstack-plugin-0.9.1 lib/vagrant-openstack-plugin/action/reboot_server.rb
vagrant-openstack-plugin-0.9.0 lib/vagrant-openstack-plugin/action/reboot_server.rb
vagrant-openstack-plugin-0.8.0 lib/vagrant-openstack-plugin/action/reboot_server.rb
vagrant-openstack-plugin-0.7.0 lib/vagrant-openstack-plugin/action/reboot_server.rb