From fabe21073d00c4bfa5c3437db4c9472c74f9f18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20K=C3=A4mmerling?= Date: Wed, 20 Feb 2019 10:23:19 +0100 Subject: [PATCH] Fix #19 --- hcloud/servers/client.py | 6 ++---- tests/unit/servers/test_client.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) 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 } )