diff --git a/hcloud/servers/client.py b/hcloud/servers/client.py index bf483239..0370db10 100644 --- a/hcloud/servers/client.py +++ b/hcloud/servers/client.py @@ -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: diff --git a/tests/unit/servers/test_client.py b/tests/unit/servers/test_client.py index dd31c071..c9d45179 100644 --- a/tests/unit/servers/test_client.py +++ b/tests/unit/servers/test_client.py @@ -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 } )