in libcloud/compute/drivers/ec2.py [0:0]
def _to_quota(self, elem):
"""
To Quota
"""
quota = {}
for reference_quota_item in findall(
element=elem, xpath="referenceQuotaSet/item", namespace=OUTSCALE_NAMESPACE
):
reference = findtext(
element=reference_quota_item,
xpath="reference",
namespace=OUTSCALE_NAMESPACE,
)
quota_set = []
for quota_item in findall(
element=reference_quota_item,
xpath="quotaSet/item",
namespace=OUTSCALE_NAMESPACE,
):
ownerId = findtext(
element=quota_item, xpath="ownerId", namespace=OUTSCALE_NAMESPACE
)
name = findtext(element=quota_item, xpath="name", namespace=OUTSCALE_NAMESPACE)
displayName = findtext(
element=quota_item,
xpath="displayName",
namespace=OUTSCALE_NAMESPACE,
)
description = findtext(
element=quota_item,
xpath="description",
namespace=OUTSCALE_NAMESPACE,
)
groupName = findtext(
element=quota_item, xpath="groupName", namespace=OUTSCALE_NAMESPACE
)
maxQuotaValue = findtext(
element=quota_item,
xpath="maxQuotaValue",
namespace=OUTSCALE_NAMESPACE,
)
usedQuotaValue = findtext(
element=quota_item,
xpath="usedQuotaValue",
namespace=OUTSCALE_NAMESPACE,
)
quota_set.append(
{
"ownerId": ownerId,
"name": name,
"displayName": displayName,
"description": description,
"groupName": groupName,
"maxQuotaValue": maxQuotaValue,
"usedQuotaValue": usedQuotaValue,
}
)
quota[reference] = quota_set
return quota