Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: assignee_type is required when creating a primary ip #409

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hcloud/primary_ips/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ def create(
data: dict[str, Any] = {
"name": name,
"type": type,
"assignee_type": assignee_type,
"auto_delete": auto_delete,
}
if datacenter is not None:
data["datacenter"] = datacenter.id_or_name
if assignee_id is not None:
data["assignee_type"] = assignee_type
data["assignee_id"] = assignee_id
if labels is not None:
data["labels"] = labels
Expand Down
1 change: 1 addition & 0 deletions tests/unit/primary_ips/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def test_create_with_datacenter(self, primary_ips_client, primary_ip_response):
json={
"name": "my-resource",
"type": "ipv6",
"assignee_type": "server",
"datacenter": "datacenter",
"auto_delete": False,
},
Expand Down