vagrant-digitalocean 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ module VagrantPlugins
5
5
  module Actions
6
6
  class SetupKey
7
7
  include Helpers::Client
8
-
8
+
9
9
  def initialize(app, env)
10
10
  @app = app
11
11
  @machine = env[:machine]
@@ -37,8 +37,9 @@ module VagrantPlugins
37
37
 
38
38
  def create_ssh_key(name, env)
39
39
  # assumes public key exists on the same path as private key with .pub ext
40
- private_key_path = @machine.config.ssh.private_key_path
41
- pub_key = DigitalOcean.public_key(private_key_path)
40
+ path = @machine.config.ssh.private_key_path
41
+ path = File.expand_path(path, @machine.env.root_path)
42
+ pub_key = DigitalOcean.public_key(path)
42
43
 
43
44
  env[:ui].info I18n.t('vagrant_digital_ocean.info.creating_key', {
44
45
  :name => name
@@ -38,8 +38,9 @@ module VagrantPlugins
38
38
  @machine.communicate.execute("su #{user} -c 'mkdir -p ~/.ssh'")
39
39
 
40
40
  # add the specified key to the authorized keys file
41
- private_key_path = @machine.ssh_info()[:private_key_path]
42
- pub_key = DigitalOcean.public_key(private_key_path)
41
+ path = @machine.config.ssh.private_key_path
42
+ path = File.expand_path(path, @machine.env.root_path)
43
+ pub_key = DigitalOcean.public_key(path)
43
44
  @machine.communicate.execute(<<-BASH)
44
45
  if ! grep '#{pub_key}' /home/#{user}/.ssh/authorized_keys; then
45
46
  echo '#{pub_key}' >> /home/#{user}/.ssh/authorized_keys;
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module DigitalOcean
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-digitalocean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-17 00:00:00.000000000 Z
12
+ date: 2013-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday