Revision e8f8f4aa
b/snf-cyclades-app/synnefo/quotas/__init__.py | ||
---|---|---|
66 | 66 |
userid = commission_info["target"] |
67 | 67 |
for provision in provisions: |
68 | 68 |
entity, resource, size = provision |
69 |
if resource == "cyclades.vm": |
|
69 |
if resource == "cyclades.vm" and size > 0:
|
|
70 | 70 |
user_vms = VirtualMachine.objects.filter(userid=userid, |
71 | 71 |
deleted=False).count() |
72 | 72 |
user_vm_limit = VMS_USER_QUOTA.get(userid, MAX_VMS_PER_USER) |
... | ... | |
74 | 74 |
user_vm_limit) |
75 | 75 |
if user_vms + size >= user_vm_limit: |
76 | 76 |
raise NoQuantityError() |
77 |
if resource == "cyclades.network.private": |
|
77 |
if resource == "cyclades.network.private" and size > 0:
|
|
78 | 78 |
user_networks = Network.objects.filter(userid=userid, |
79 | 79 |
deleted=False).count() |
80 | 80 |
user_network_limit =\ |
Also available in: Unified diff