Skip to content

Commit

Permalink
Merge pull request devopsgroup-io#300 from lamech/298-vagrant-2_3_6-b…
Browse files Browse the repository at this point in the history
…reaks-digitalocean-plugin

Relates to devopsgroup-io#298: Fix for ruby 3.x named parameter syntax changes.
  • Loading branch information
seth-reeser authored Sep 7, 2023
2 parents adf683e + fe258bd commit 69550d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
8 changes: 2 additions & 6 deletions lib/vagrant-digitalocean/actions/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,9 @@ def call(env)
droplet = Provider.droplet(@machine, :refresh => true)
public_network = droplet['networks']['v4'].find { |network| network['type'] == 'public' }
private_network = droplet['networks']['v4'].find { |network| network['type'] == 'private' }
env[:ui].info I18n.t('vagrant_digital_ocean.info.droplet_ip', {
:ip => public_network['ip_address']
})
env[:ui].info I18n.t('vagrant_digital_ocean.info.droplet_ip', :ip => public_network['ip_address'])
if private_network
env[:ui].info I18n.t('vagrant_digital_ocean.info.droplet_private_ip', {
:ip => private_network['ip_address']
})
env[:ui].info I18n.t('vagrant_digital_ocean.info.droplet_private_ip', :ip => private_network['ip_address'])
end

# wait for ssh to be ready
Expand Down
8 changes: 2 additions & 6 deletions lib/vagrant-digitalocean/actions/setup_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ def call(env)
.request('/v2/account/keys')
.find_id(:ssh_keys, :name => ssh_key_name)

env[:ui].info I18n.t('vagrant_digital_ocean.info.using_key', {
:name => ssh_key_name
})
env[:ui].info I18n.t('vagrant_digital_ocean.info.using_key', :name => ssh_key_name)
rescue Errors::ResultMatchError
env[:ssh_key_id] = create_ssh_key(ssh_key_name, env)
end
Expand All @@ -42,9 +40,7 @@ def create_ssh_key(name, env)
path = File.expand_path(path, @machine.env.root_path)
pub_key = DigitalOcean.public_key(path)

env[:ui].info I18n.t('vagrant_digital_ocean.info.creating_key', {
:name => name
})
env[:ui].info I18n.t('vagrant_digital_ocean.info.creating_key', :name => name)

result = @client.post('/v2/account/keys', {
:name => name,
Expand Down
4 changes: 1 addition & 3 deletions lib/vagrant-digitalocean/actions/setup_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ def call(env)
user = @machine.config.ssh.username
@machine.config.ssh.username = 'root'

env[:ui].info I18n.t('vagrant_digital_ocean.info.creating_user', {
:user => user
})
env[:ui].info I18n.t('vagrant_digital_ocean.info.creating_user', :user => user)

# create user account
@machine.communicate.execute(<<-BASH)
Expand Down

0 comments on commit 69550d6

Please sign in to comment.