openstack-image-manager icon indicating copy to clipboard operation
openstack-image-manager copied to clipboard

Reduce number of unnecessary roundtrips to Glance

Open mbuechse opened this issue 2 years ago • 1 comments

There are many unnecessary roundtrips in manage.py:

  • Each time an image is uploaded, the whole list of images is retrieved anew, instead of just adding the newly uploaded image to the list.
  • For the subsequent call of set_properties, the whole list of images is again retrieved, when the actual image object could be passed to the function instead of just the name. (Mind you that this is the only call to set_properties ever, so it could readily be changed!)
  • For each of the potential adjustments of the metadata (min disk, min ram, os hidden, as well as each and every property that is missing or has the wrong value), a dedicated call to update_image is performed, when the changes could (easily!) be aggregated and the image updated only once.

mbuechse avatar Sep 26 '23 07:09 mbuechse

The first item in my list came into existence with this commit: https://github.com/osism/openstack-image-manager/commit/47e0727b2a7bdd2367672f70d08f0606509d9a78#diff-382a7342c7615f4f749a89ded32a088038682637699dfc29a6994c7ab490d668R89-R90

mbuechse avatar Sep 26 '23 07:09 mbuechse