diff --git a/openstack_dashboard/api/glance.py b/openstack_dashboard/api/glance.py index 839beb3a1a..a1420e640c 100644 --- a/openstack_dashboard/api/glance.py +++ b/openstack_dashboard/api/glance.py @@ -126,9 +126,22 @@ def image_update(request, image_id, **kwargs): def image_create(request, **kwargs): - copy_from = kwargs.pop('copy_from', None) + """Create image. + + Keyword arguments: + copy_from -- URL from which Glance server should immediately copy + the data and store it in its configured image store. + data -- Form data posted from client. + location -- URL where the data for this image already resides. + + In the case of 'copy_from' and 'location' the Glance server + will give us a immediate response from create and handle the data + asynchronously. + + In the case of 'data' the process of uploading the data may take + some time and is handed off to a seperate thread. + """ data = kwargs.pop('data', None) - location = kwargs.pop('location', None) image = glanceclient(request).images.create(**kwargs) @@ -146,16 +159,6 @@ def image_create(request, **kwargs): (request, image.id), {'data': data, 'purge_props': False}) - elif copy_from: - thread.start_new_thread(image_update, - (request, image.id), - {'copy_from': copy_from, - 'purge_props': False}) - elif location: - thread.start_new_thread(image_update, - (request, image.id), - {'location': location, - 'purge_props': False}) return image