Skip to content

Commit

Permalink
Improve and fix Hetzner flavor info (#776)
Browse files Browse the repository at this point in the history
Fixes formatting so that flavor_option and location is actually interpolated and then improves the message.
  • Loading branch information
larssb authored Jan 28, 2025
1 parent 6b1350c commit c1fe114
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kvirt/providers/hcloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ def create(self, name, virttype=None, profile='', flavor=None, plan='kvirt', cpu
break
except APIException as e:
if e.code == "resource_unavailable":
msg = "Could not get server of type '{flavor_option}' in location '{self.location.name}' now"
msg = f"Could not get server of type '{flavor_option}' in location '{self.location.name}'"
if len(flavor_options) > (idx + 1):
warning(f"{msg}' at current time, trying next flavor")
warning(f"{msg}' trying the next configured flavor option.")
else:
warning(msg)
error("No more flavors available to try. Define more flavors in 'flavor_options'")
error("No more flavors available to try. Define more flavors in 'flavor_options'.")

created_vm = created_vm.server

Expand Down

0 comments on commit c1fe114

Please sign in to comment.