UpCloudLtd / upcloud-python-api

Python client for UpCloud's API
MIT License
53 stars 21 forks source link

Creating Ubuntu 18.04 server errors out #54

Closed skulltech closed 5 years ago

skulltech commented 5 years ago
manager = upcloud_api.CloudManager('api_user', 'password')
manager.authenticate()

login_user = login_user_block(username=api_user, ssh_keys=['ssh_key'], create_password=True)
server = Server(core_number=1, memory_amount=1024, zone=ZONE.London, hostname='hostname',
            storage_devices=[Storage(os='Ubuntu 18.04', size=25)], login_user=login_user)

The above code errors out, the traceback being

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sumit/Coding/removeads.org/server/utils.py", line 29, in create_server
    manager.create_server(server)
  File "/home/sumit/.local/lib/python3.6/site-packages/upcloud_api/cloud_manager/server_mixin.py", line 114, in create_server
    body = server.prepare_post_body()
  File "/home/sumit/.local/lib/python3.6/site-packages/upcloud_api/server.py", line 347, in prepare_post_body
    storage_body['storage'] = OperatingSystems.get_OS_UUID(storage.os)
  File "/home/sumit/.local/lib/python3.6/site-packages/upcloud_api/constants.py", line 55, in get_OS_UUID
    "Invalid OS -- valid options are: 'CentOS 6.5', 'CentOS 7.0', "
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'
alienhaxor commented 5 years ago

It's fixed in 0.4.3, I updated the pip package.