Skip to content

Commit

Permalink
Merge pull request #39 from infn-datacloud/fix-quota-update
Browse files Browse the repository at this point in the history
Fix update quotas functions
  • Loading branch information
giosava94 authored Sep 1, 2024
2 parents acc11db + 157ee5d commit 7a05222
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions fed_reg/service/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,14 @@ def __update_quotas( # noqa: C901
if item.usage:
db_item = db_items_usage.pop(item.project, None)
if not db_item:
block_storage_quota_mng.create(
compute_quota_mng.create(
obj_in=item,
service=db_obj,
project=db_projects.get(item.project),
)
edit = True
else:
updated_data = block_storage_quota_mng.update(
updated_data = compute_quota_mng.update(
db_obj=db_item,
obj_in=item,
projects=provider_projects,
Expand Down Expand Up @@ -495,7 +495,7 @@ def __update_quotas( # noqa: C901
edit = True

for db_item in db_items_usage.values():
block_storage_quota_mng.remove(db_obj=db_item)
compute_quota_mng.remove(db_obj=db_item)
edit = True
for db_item in db_items_per_user.values():
compute_quota_mng.remove(db_obj=db_item)
Expand Down Expand Up @@ -688,14 +688,14 @@ def __update_quotas( # noqa: C901
if item.usage:
db_item = db_items_usage.pop(item.project, None)
if not db_item:
block_storage_quota_mng.create(
network_quota_mng.create(
obj_in=item,
service=db_obj,
project=db_projects.get(item.project),
)
edit = True
else:
updated_data = block_storage_quota_mng.update(
updated_data = network_quota_mng.update(
db_obj=db_item,
obj_in=item,
projects=provider_projects,
Expand Down Expand Up @@ -741,7 +741,7 @@ def __update_quotas( # noqa: C901
edit = True

for db_item in db_items_usage.values():
block_storage_quota_mng.remove(db_obj=db_item)
network_quota_mng.remove(db_obj=db_item)
edit = True
for db_item in db_items_per_user.values():
network_quota_mng.remove(db_obj=db_item)
Expand Down Expand Up @@ -855,14 +855,14 @@ def __update_quotas( # noqa: C901
if item.usage:
db_item = db_items_usage.pop(item.project, None)
if not db_item:
block_storage_quota_mng.create(
object_store_quota_mng.create(
obj_in=item,
service=db_obj,
project=db_projects.get(item.project),
)
edit = True
else:
updated_data = block_storage_quota_mng.update(
updated_data = object_store_quota_mng.update(
db_obj=db_item,
obj_in=item,
projects=provider_projects,
Expand Down Expand Up @@ -908,7 +908,7 @@ def __update_quotas( # noqa: C901
edit = True

for db_item in db_items_usage.values():
block_storage_quota_mng.remove(db_obj=db_item)
object_store_quota_mng.remove(db_obj=db_item)
edit = True
for db_item in db_items_per_user.values():
object_store_quota_mng.remove(db_obj=db_item)
Expand Down

0 comments on commit 7a05222

Please sign in to comment.