Sha256: 267c817abce398f1a0ea00f1eeb6c1b3d427abe75e6723ce404bbf2842643936

Contents?: true

Size: 1.57 KB

Versions: 1

Compression:

Stored size: 1.57 KB

Contents

begin
  require 'vagrant'
rescue LoadError
  raise 'The Openstack Cloud provider must be run within Vagrant.'
end

require 'vagrant-openstack-illuin-provider/version_checker'

# This is a sanity check to make sure no one is attempting to install
# this into an early Vagrant version.
if Vagrant::VERSION < '1.4.0'
  fail 'Openstack Cloud provider is only compatible with Vagrant 1.4+'
end

module VagrantPlugins
  module Openstack
    class Plugin < Vagrant.plugin('2')
      name 'Openstack Cloud'
      description <<-DESC
      This plugin enables Vagrant to manage machines in Openstack Cloud.
      DESC

      config(:openstack_illuin, :provider) do
        require_relative 'config'
        Config
      end

      provider(:openstack_illuin, box_optional: true, parallel: true) do
        Openstack.init_i18n
        Openstack.init_logging
        VagrantPlugins::Openstack.check_version

        # Load the actual provider
        require_relative 'provider'
        Provider
      end

      # TODO: Remove the if guard when Vagrant 1.8.0 is the minimum version.
      # rubocop:disable IndentationWidth
      if Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('1.8.0')
      provider_capability('openstack', 'snapshot_list') do
        require_relative 'cap/snapshot_list'
        Cap::SnapshotList
      end
      end
      # rubocop:enable IndentationWidth

      command('openstack') do
        Openstack.init_i18n
        Openstack.init_logging
        VagrantPlugins::Openstack.check_version

        require_relative 'command/main'
        Command::Main
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-openstack-illuin-provider-0.12.0 lib/vagrant-openstack-illuin-provider/plugin.rb