Sha256: 8d466a9fa2757fe8366d5e55dc1989341398021b99d3f007f2d107b2a7ef3905

Contents?: true

Size: 879 Bytes

Versions: 20

Compression:

Stored size: 879 Bytes

Contents

module VagrantVbguest
  module Helpers

    module Rebootable
      include VmCompatible
      def self.included(base)
        base.extend(ClassMethods)
      end

      @@rebooted = {}

      def rebooted?(vm)
        !!@@rebooted[ self.class.vm_id(vm) ]
      end

      def reboot?(vm, options)
        if rebooted?(vm)
          vm.env.ui.error(I18n.t("vagrant_vbguest.restart_loop_guard_activated"))
          false
        elsif options[:auto_reboot]
          vm.env.ui.warn(I18n.t("vagrant_vbguest.restart_vm"))
          @@rebooted[ self.class.vm_id(vm) ] = true
        else
          vm.env.ui.warn(I18n.t("vagrant_vbguest.suggest_restart", :name => vm.name))
          false
        end
      end

      def reboot(vm, options)
        raise NotImplementedError
      end

      def reboot!(vm, options)
        raise NotImplementedError
      end
    end

  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
vagrant-vbguest-0.16.0 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.16.0.beta1 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.15.2 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.15.1 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.15.0 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.14.2 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.14.1 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.14.0 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.14.0.pre.beta1 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.13.0 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.12.0 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.11.0 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.11.0.beta0 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.10.1 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-update-0.10.1.dev lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.10.0 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.10.0.pre1 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.10.0.pre0 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.9.0 lib/vagrant-vbguest/rebootable.rb
vagrant-vbguest-0.8.0 lib/vagrant-vbguest/rebootable.rb