dswd/ToMaTo — Issue #123: Bug: multiple resources for one slot
Author: dswd
Created: 2011-11-22 10:10:36+00:00
State: open
Labels: backend, defect

```
MultipleObjectsReturned:get() returned more than one ResourceEntry -- it returned 2! Lookup parameters were {'slot': 'vmid', 'owner_type': 'D', 'owner_id': 4580}
Type: error
Occurrences: 84
First occurence: 20111118T19:03:50
Last occurence: 20111122T10:53:32
Traceback (most recent call last):
File "/usr/share/tomato/backend/tomato/topology.py", line 417, in updateResourceUsage
dev.updateResourceUsage()
File "/usr/share/tomato/backend/tomato/devices/__init__.py", line 223, in updateResourceUsage
res = self.upcast().getResourceUsage()
File "/usr/share/tomato/backend/tomato/devices/openvz.py", line 428, in getResourceUsage
if self.host and self.getVmid():
File "/usr/share/tomato/backend/tomato/devices/common.py", line 60, in getVmid
res = resources.get(self, self.VMID_SLOT, "vmid")
File "/usr/share/tomato/backend/tomato/hosts/resources.py", line 184, in get
res = ResourceEntry.objects.get(owner_type=owner_type, owner_id=owner_id, slot=slot)
File "/usr/lib/pymodules/python2.6/django/db/models/manager.py", line 132, in get
return self.get_query_set().get(*args, **kwargs)
File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 343, in get
% (self.model._meta.object_name, num, kwargs))
MultipleObjectsReturned: get() returned more than one ResourceEntry -- it returned 2! Lookup parameters were {'slot': 'vmid', 'owner_type': 'D', 'owner_id': 4580}
```