Sha256: 8637d750d238b643aecfaa9f0080c63b8e2b47f8e03cda70286208be2f6eafdc

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

module Vagrant
  module Action
    module Builtin
      class Disk
        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant::action::builtin::disk")
        end

        def call(env)
          machine = env[:machine]
          defined_disks = get_disks(machine, env)

          # Call into providers machine implementation for disk management
          if !defined_disks.empty?
            if machine.provider.capability?(:configure_disks)
             machine.provider.capability(:configure_disks, defined_disks)
            else
              env[:ui].warn(I18n.t("vagrant.actions.disk.provider_unsupported",
                                 provider: machine.provider_name))
            end
          end

          # Continue On
          @app.call(env)
        end

        def get_disks(machine, env)
          return @_disks if @_disks

          @_disks = []
          @_disks = machine.config.vm.disks

          @_disks
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-unbundled-2.2.7.0 lib/vagrant/action/builtin/disk.rb