Commit e188a032 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Caching key has more them one variable

parent 4905b543
......@@ -62,8 +62,8 @@ if can_allocate:
def getSoftwareReleaseCapacity(instance):
software_release_url = instance.getUrlString()
software_type = instance.getSourceReference()
if software_release_url in software_release_capacity_dict:
return software_release_capacity_dict[software_release_url]
if "%s-%s" % (software_release_url, software_type) in software_release_capacity_dict:
return software_release_capacity_dict["%s-%s" % (software_release_url, software_type)]
software_release = portal.portal_catalog.getResultValue(
portal_type='Software Release',
......@@ -90,7 +90,7 @@ if can_allocate:
if software_release_capacity is None:
software_release_capacity = 1
software_release_capacity_dict[software_release_url] = software_release_capacity
software_release_capacity_dict["%s-%s" % (software_release_url, software_type)] = software_release_capacity
return software_release_capacity
if allocated_instance is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment