1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 15:15:22 +00:00

instance resize check_user_quota correct cpu/memory resize amount. only differrence from current state should be provided for the function

This commit is contained in:
Jan Krcmar 2016-03-23 14:11:23 +01:00
parent bc0552e12e
commit 1e84dcbbc9

View file

@ -397,7 +397,7 @@ def instance(request, compute_id, vname):
if input_disk_size > disk['size']+(64<<20):
disk['size_new'] = input_disk_size
disks_new.append(disk)
quota_msg = check_user_quota(0, vcpu, memory)
quota_msg = check_user_quota(0, int(vcpu)-conn.get_vcpu(), int(memory)-conn.get_memory())
if not request.user.is_superuser and quota_msg:
msg = _("User %s quota reached, cannot resize '%s'!" % (quota_msg, instance.name))
error_messages.append(msg)