addImage does not upload the image
marcellom opened this issue · 2 comments
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.
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/).
Code changes in the master branch occurred which cause this to work now.