Sha256: 7152a66795102c419e59ecceca62c195c8b79c6e41c82c1cf31dddbf87f41dfd

Contents?: true

Size: 1.04 KB

Versions: 5

Compression:

Stored size: 1.04 KB

Contents

require 'pathname'
require 'vagrant-libvirt/plugin'

module VagrantPlugins
  module Libvirt
    lib_path = Pathname.new(File.expand_path("../vagrant-libvirt", __FILE__))
    autoload :Action, lib_path.join("action")
    autoload :Errors, lib_path.join("errors")
    autoload :Util, lib_path.join("util")

    # Hold connection handler so there is no need to connect more times than
    # one. This can be annoying when there are more machines to create, or when
    # doing state action first and then some other.
    #
    # TODO Don't sure if this is the best solution
    @@libvirt_connection = nil
    def self.libvirt_connection
      @@libvirt_connection
    end

    def self.libvirt_connection=(conn)
      @@libvirt_connection = conn
    end

    def self.source_root
      @source_root ||= Pathname.new(File.expand_path("../../", __FILE__))
    end
  end
end

# set provider by bash env
# export VAGRANT_DEFAULT_PROVIDER=libvirt
Vagrant::Environment.class_eval do
  def default_provider
    (ENV['VAGRANT_DEFAULT_PROVIDER'] || :virtualbox).to_sym
  end
end


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vagrant-libvirt-0.0.6 lib/vagrant-libvirt.rb
vagrant-libvirt-0.0.5 lib/vagrant-libvirt.rb
vagrant-libvirt-0.0.4 lib/vagrant-libvirt.rb
vagrant-libvirt-0.0.3 lib/vagrant-libvirt.rb
vagrant-libvirt-0.0.2 lib/vagrant-libvirt.rb