Skip to content

Commit

Permalink
Merge pull request #65 from ajmyyra/ubuntu-2020-template-update
Browse files Browse the repository at this point in the history
Templates: added Ubuntu 20.04
  • Loading branch information
Darep authored May 27, 2020
2 parents 311760a + c07ee07 commit 1bacb4c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
16 changes: 8 additions & 8 deletions test/test_server_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class TestCreateServer(object):

def test_storage_prepare_post_body(self, manager):
s1 = Storage(os='Ubuntu 14.04', size=10)
s1 = Storage(os='Ubuntu 20.04', size=10)
body1 = s1.to_dict()
assert body1['tier'] == 'maxiops'
assert body1['size'] == 10
Expand All @@ -39,7 +39,7 @@ def test_server_init(self, manager):
hostname='my.example.com',
zone=ZONE.Chicago,
storage_devices=[
Storage(os='Ubuntu 14.04', size=10),
Storage(os='Ubuntu 20.04', size=10),
Storage(size=100, title='storage disk 1')
])

Expand All @@ -57,7 +57,7 @@ def test_server_prepare_post_body(self):
hostname='my.example.com',
zone=ZONE.Chicago,
storage_devices=[
Storage(os='Ubuntu 14.04', size=10),
Storage(os='Ubuntu 20.04', size=10),
Storage()
]
)
Expand All @@ -67,7 +67,7 @@ def test_server_prepare_post_body(self):
assert s1['title'] == 'my.example.com OS disk'
assert s1['tier'] == 'maxiops'
assert s1['size'] == 10
assert s1['storage'] == '01000000-0000-4000-8000-000030040200'
assert s1['storage'] == '01000000-0000-4000-8000-000030200200'
assert s1['action'] == 'clone'
s2 = body['server']['storage_devices']['storage_device'][1]
assert s2['title'] == 'my.example.com storage disk 1'
Expand All @@ -89,7 +89,7 @@ def test_server_prepare_post_body_optional_attributes(self):
zone=ZONE.Chicago,
storage_devices=[
Storage(
os='Ubuntu 14.04',
os='Ubuntu 20.04',
size=10
)
],
Expand All @@ -111,7 +111,7 @@ def test_server_prepare_post_body_optional_attributes(self):
'hostname':'my.example.com',
'zone': ZONE.Chicago,
'storage_devices':[
{'os': 'Ubuntu 14.04', 'size': 10}
{'os': 'Ubuntu 20.04', 'size': 10}
],
'vnc_password': 'my-passwd',
'password_delivery': 'email',
Expand Down Expand Up @@ -171,7 +171,7 @@ def test_create_server(self, manager):
hostname='my.example.com',
zone=ZONE.Chicago,
storage_devices=[
Storage(os='Ubuntu 14.04', size=10),
Storage(os='Ubuntu 20.04', size=10),
Storage(size=100, title='storage disk 1')
]
)
Expand Down Expand Up @@ -208,7 +208,7 @@ def test_create_server_with_dict(self, manager):
'hostname': 'my.example.com',
'zone': ZONE.Chicago,
'storage_devices': [
{'os': 'Ubuntu 14.04', 'size': 10},
{'os': 'Ubuntu 20.04', 'size': 10},
{'size': 100, 'title': 'storage disk 1'},
]
}
Expand Down
11 changes: 6 additions & 5 deletions upcloud_api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ class OperatingSystems(object):
'Debian 8.11': '01000000-0000-4000-8000-000020030100',
'Debian 9.9': '01000000-0000-4000-8000-000020040100',
'Debian 10.0': '01000000-0000-4000-8000-000020050100',
'Ubuntu 14.04': '01000000-0000-4000-8000-000030040200',
'Ubuntu 16.04': '01000000-0000-4000-8000-000030060200',
'Ubuntu 18.04': '01000000-0000-4000-8000-000030080200',
'Ubuntu 20.04': '01000000-0000-4000-8000-000030200200',
'CoreOS Stable 1068.8.0': '01000000-0000-4000-8000-000080010200',
'Windows 2012': '01000000-0000-4000-8000-000010050200',
'Windows 2016': '01000000-0000-4000-8000-000010060200',
'Windows 2019': '01000000-0000-4000-8000-000010070200',
}
Expand All @@ -55,7 +54,9 @@ def get_OS_UUID(cls, os):
return os

raise Exception((
"Invalid OS -- valid options are: 'CentOS 6.5', 'CentOS 7.0', "
"'Debian 7.8', 'Debian 8.0' ,'Ubuntu 12.04', 'Ubuntu 14.04', 'Ubuntu 16.04', "
"'Windows 2008', 'Windows 2012'"
"Invalid OS -- valid options are: "
"'CentOS 6.10', 'CentOS 7', 'Centos 8', "
"'Debian 8.11', 'Debian 9.9', 'Debian 10.10', "
"'Ubuntu 12.04', 'Ubuntu 16.04', 'Ubuntu 18.04', 'Ubuntu 20.04', "
"'Windows 2016', 'Windows 2019'"
))

0 comments on commit 1bacb4c

Please sign in to comment.