Skip to content

Commit

Permalink
Adjust network calls to hcloud 1.2
Browse files Browse the repository at this point in the history
Some methods and their return values changed within the 1.2 release.
  • Loading branch information
bastelfreak committed Nov 1, 2023
1 parent 97e65a8 commit c56ac72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion beaker-hcloud.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'bcrypt_pbkdf', '~> 1.0'
s.add_runtime_dependency 'beaker', '~> 5.4'
s.add_runtime_dependency 'ed25519', '~> 1.2'
s.add_runtime_dependency 'hcloud', '~> 1.1'
s.add_runtime_dependency 'hcloud', '~> 1.2'
s.add_runtime_dependency 'ssh_data', '~> 1.3'
end
6 changes: 3 additions & 3 deletions lib/beaker/hypervisor/hcloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def create_server(host)
@logger.notify "provisioning #{host.name}"
location = host[:location] || 'nbg1'
server_type = host[:server_type] || 'cx11'
action, server = @client.servers.create(
action, server, _password, _next_action = @client.servers.create(
name: host.hostname,
location: location,
server_type: server_type,
Expand All @@ -100,8 +100,8 @@ def create_server(host)
action = @client.actions.find(action.id)
server = @client.servers.find(server.id)
end
host[:ip] = server.public_net['ipv4']['ip']
host[:vmhostname] = server.public_net['ipv4']['dns_ptr']
host[:ip] = server.public_net['ipv4'].ip
host[:vmhostname] = server.public_net['ipv4'].dns_ptr.first['dns_ptr']
host[:hcloud_id] = server.id
host.options[:ssh][:keys] = [@key_file.path]
server
Expand Down

0 comments on commit c56ac72

Please sign in to comment.