apyrgio / synnefo

Synnefo is open source cloud software, used to create massively scalable IaaS clouds.
GNU General Public License v3.0
0 stars 0 forks source link

Handle cases when the same image is registered more than one time #331

Open apyrgio opened 9 years ago

apyrgio commented 9 years ago

In the details page of a VM, we require some information about the VM's image. This is currently done using the following Django query:

image_info = Image.objects.get(uuid=vm.imageid)

This is wrong though, since the uuid in the Image model is not unique. What's unique is the combination of image uuid and image version. Therefore, the query must change in this:

image_info = Image.objects.get(uuid=vm.imageid, version=vm.image_version)