Skip to content

Commit

Permalink
openstack: set minimum for object quota to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jtriley committed May 13, 2024
1 parent e4a225b commit 9f8d2b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/coldfront_plugin_cloud/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,12 @@ def _set_object_quota(self, project_id, payload):
# Note(knikolla): For consistency with other OpenStack
# quotas we're storing this as GB on the attribute and
# converting to bytes for Swift.
payload[QUOTA_KEY_MAPPING['object']['keys'][
attributes.QUOTA_OBJECT_GB]
] *= GB_IN_BYTES
obj_q_mapping = QUOTA_KEY_MAPPING['object']['keys'][
attributes.QUOTA_OBJECT_GB
]
payload[obj_q_mapping] *= GB_IN_BYTES
if payload[obj_q_mapping] <= 0:
payload[obj_q_mapping] = 1
self.object(project_id).post_account(headers=payload)
except ksa_exceptions.catalog.EndpointNotFound:
logger.debug('No swift available, skipping its quota.')
Expand Down

0 comments on commit 9f8d2b7

Please sign in to comment.