2013-03-27 00:55:30 +01:00
|
|
|
require 'pathname'
|
|
|
|
|
require 'vagrant-libvirt/plugin'
|
|
|
|
|
|
|
|
|
|
module VagrantPlugins
|
2013-07-31 09:20:43 +09:00
|
|
|
module ProviderLibvirt
|
2013-10-19 23:10:31 +02:00
|
|
|
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')
|
2013-03-27 00:55:30 +01:00
|
|
|
|
|
|
|
|
# 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.
|
2013-03-27 09:43:32 +01:00
|
|
|
#
|
2013-03-27 00:55:30 +01:00
|
|
|
# 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
|
2013-10-19 23:10:31 +02:00
|
|
|
@source_root ||= Pathname.new(File.expand_path('../../', __FILE__))
|
2013-03-27 09:43:32 +01:00
|
|
|
end
|
2013-03-27 00:55:30 +01:00
|
|
|
end
|
|
|
|
|
end
|