Revision 847
Added by Borja Sotomayor over 13 years ago
branches/1.1/src/haizea/core/leases.py | ||
---|---|---|
1785 | 1785 |
res.set("type", res_type) |
1786 | 1786 |
ninstances = capacity.get_ninstances(res_type) |
1787 | 1787 |
if ninstances == 1: |
1788 |
res.set("amount", str(capacity.get_quantity(res_type))) |
|
1788 |
res.set("amount", str(capacity.get_quantity(res_type))) |
|
1789 |
else: |
|
1790 |
for instance in range(1,ninstances+1): |
|
1791 |
inst_elem = ET.SubElement(res, "instance") |
|
1792 |
inst_elem.set("amount", str(capacity.get_quantity_instance(res_type, instance))) |
|
1789 | 1793 |
|
1790 | 1794 |
return nodes |
1791 | 1795 |
|
Also available in: Unified diff
Fixed: Lease-to-XML did not take into account multi-instance resources.