Skip to content

Commit d81a618

Browse files
authored
Fix #19 - SSH Key Error on Server Creation (#20)
The PR works as it is. We need to wait on the docs deployment before the integration tests can work.
1 parent ae6b4d4 commit d81a618

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

hcloud/servers/client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,12 @@ def create(self,
208208

209209
if location is not None:
210210
data['location'] = location.id_or_name
211-
212211
if datacenter is not None:
213212
data['datacenter'] = datacenter.id_or_name
214-
215213
if ssh_keys is not None:
216-
data['ssh_keys'] = [str(ssh_key.id_or_name) for ssh_key in ssh_keys]
214+
data['ssh_keys'] = [ssh_key.id_or_name for ssh_key in ssh_keys]
217215
if volumes is not None:
218-
data['volumes'] = [str(volume.id) for volume in volumes]
216+
data['volumes'] = [volume.id for volume in volumes]
219217
if user_data is not None:
220218
data['user_data'] = user_data
221219
if labels is not None:

tests/unit/servers/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def test_create_with_volumes(self, servers_client, response_create_simple_server
439439
'name': "my-server",
440440
'server_type': "cx11",
441441
'image': 4711,
442-
'volumes': ['1', '2'],
442+
'volumes': [1, 2],
443443
"start_after_create": False
444444
}
445445
)

0 commit comments

Comments
 (0)