openbaton / openstack4j-plugin

Apache License 2.0
3 stars 12 forks source link

addImage does not upload the image #11

Closed marcellom closed 6 years ago

marcellom commented 7 years ago

The method starts the uploading of the image correctly, setting in OpenStack "queued" state, but it hangs indefinitely. So the image does not reach the "saving" state.

marcellom commented 7 years ago

The problem is related to how the process is handled. The thread https://github.com/openbaton/openstack4j-plugin/blob/develop/src/main/java/org/openbaton/drivers/openstack4j/OpenStack4JDriver.java#L888-L894 requests another token and the method upload does not work anymore. If you remove the thread and upload directly, it works. So the fix should be to create the thread at the beginning, which manages the Payloads.create and the image.upload.
Passing the actual osClient to the thread through a constructor does not work because the session is thread scoped (http://www.openstack4j.com/learn/threads/).

RuthDevlaeminck commented 6 years ago

Code changes in the master branch occurred which cause this to work now.