Skip to content
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
6 changes: 2 additions & 4 deletions hcloud/servers/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,12 @@ def create(self,

if location is not None:
data['location'] = location.id_or_name

if datacenter is not None:
data['datacenter'] = datacenter.id_or_name

if ssh_keys is not None:
data['ssh_keys'] = [str(ssh_key.id_or_name) for ssh_key in ssh_keys]
data['ssh_keys'] = [ssh_key.id_or_name for ssh_key in ssh_keys]
if volumes is not None:
data['volumes'] = [str(volume.id) for volume in volumes]
data['volumes'] = [volume.id for volume in volumes]
if user_data is not None:
data['user_data'] = user_data
if labels is not None:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/servers/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def test_create_with_volumes(self, servers_client, response_create_simple_server
'name': "my-server",
'server_type': "cx11",
'image': 4711,
'volumes': ['1', '2'],
'volumes': [1, 2],
"start_after_create": False
}
)
Expand Down