Merge pull request #47 from pronix/master

close  #43 set key file in url
This commit is contained in:
Dmitry Vasilets 2013-08-14 17:05:06 -07:00
commit 97a0677e85
4 changed files with 11 additions and 7 deletions

View File

@ -6,7 +6,7 @@ module VagrantPlugins
module Action
class ConnectLibvirt
def initialize(app, env)
@logger = Log4r::Logger.new("vagrant_libvirt::action::connect_libvirt")
@logger = Log4r::Logger.new('vagrant_libvirt::action::connect_libvirt')
@app = app
end
@ -39,7 +39,11 @@ module VagrantPlugins
uri << '://'
uri << config.host if config.host
end
uri << '/system?no_verify=1'
# set ssh key for access to libvirt host
home_dir = `echo ${HOME}`.chomp
uri << "&keyfile=#{home_dir}/.ssh/id_rsa"
conn_attr = {}
conn_attr[:provider] = 'libvirt'

View File

@ -12,8 +12,8 @@ module VagrantPlugins
end
def call(env)
env[:machine_ssh_info] = read_ssh_info(
env[:libvirt_compute], env[:machine])
env[:machine_ssh_info] = read_ssh_info(env[:libvirt_compute],
env[:machine])
@app.call(env)
end
@ -53,7 +53,7 @@ module VagrantPlugins
end
ssh_info
end
end
end
end
end

View File

@ -45,7 +45,7 @@ module VagrantPlugins
# :username => "mitchellh",
# :private_key_path => "/path/to/my/key"
#}
env = @machine.action("read_ssh_info")
env = @machine.action('read_ssh_info')
env[:machine_ssh_info]
end
@ -55,7 +55,7 @@ module VagrantPlugins
# Run a custom action we define called "read_state" which does
# what it says. It puts the state in the `:machine_state_id`
# key in the environment.
env = @machine.action("read_state")
env = @machine.action('read_state')
state_id = env[:machine_state_id]

View File

@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.version = VagrantPlugins::ProviderLibvirt::VERSION
gem.add_runtime_dependency "fog", "~> 1.10.0"
gem.add_runtime_dependency "fog", "1.10.0"
gem.add_runtime_dependency "ruby-libvirt", "~> 0.4.0"
gem.add_development_dependency "rake"