Skip to content

Commit 8989841

Browse files
author
Elias Nygren
committed
support Server.user_data
1 parent 475db77 commit 8989841

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

test/test_server_creation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ def test_server_prepare_post_body_optional_attributes(self):
106106
vnc_password='my-passwd',
107107
password_delivery='email',
108108
login_user=login_user_block('upclouduser', ['this-is-a-SSH-key']),
109-
avoid_host='12345678'
109+
avoid_host='12345678',
110+
user_data='https://my.script.com/some_script.py'
110111
)
111112

112113
body = server.prepare_post_body()
@@ -125,6 +126,7 @@ def test_server_prepare_post_body_optional_attributes(self):
125126
}
126127
}
127128
assert body['server']['avoid_host'] == '12345678'
129+
assert body['server']['user_data'] == 'https://my.script.com/some_script.py'
128130

129131
@responses.activate
130132
def test_create_server(self, manager):

upcloud_api/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Server(object):
4747
optional_fields = [
4848
'plan', 'core_number', 'memory_amount', 'boot_order', 'firewall', 'nic_model',
4949
'timezone', 'video_model', 'vnc_password', 'password_delivery', 'avoid_host',
50-
'login_user'
50+
'login_user', 'user_data'
5151
]
5252

5353
def __init__(self, server=None, **kwargs):

0 commit comments

Comments
 (0)