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 fe134a4 commit 72e5425
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions beaker-hcloud.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +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'
# pin to 1.1. 1.2 uses blank? a lot but without the correct dependency
s.add_runtime_dependency 'hcloud', '~> 1.1'
s.add_runtime_dependency 'hcloud', '~> 1.2'
s.add_runtime_dependency 'ssh_data', '~> 1.3'
# pin to 6.x because hcloud only works with that, but has no upper version constraint and pulls in activemodel 7
#s.add_runtime_dependency 'activemodel', ' ~> 6.0'
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 72e5425

Please sign in to comment.