UpCloudLtd / upcloud-python-api

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

Getting self.uuid error when cloning a server #115

Closed pottertech closed 2 years ago

pottertech commented 2 years ago

Traceback (most recent call last): File "buildServer.py", line 40, in print(clone) File "/Users/skip/Library/Python/2.7/lib/python/site-packages/upcloud_api/server.py", line 110, in str return self.uuid

===== CODE ======= id = uuid.uuid4().hex[:10].lower() cloneUUID = str(sys.argv[1])

manager = upcloud_api.CloudManager('username', 'password') manager.authenticate()

if cloneZONE == 'Singapore' : print('Singapore') storage = manager.get_storage(cloneUUID) print(storage.zone) print(storage.uuid) print(storage.size)

clone = Server(core_number=1, memory_account=1024, hostname='CloneServer.' + id, zone=storage.zone, storage_devices=[Storage(uuid=storage.uuid,size=storage.size),])

thevilledev commented 2 years ago

Hello @pottertech, based on your output you're using Python 2.7. Note that the latest library version v2.0.0 is only supported on Python 3. If you really need to use Python 2.7 you'll need to use an older version of the library (<v2.0.0, for example v1.0.1). Python 3 is recommended though.

In case you're still experiencing issues with the latest library version and Python 3 let us know. Also please provide a complete example and additional information such as Python version. For now I'll close this off.