Skip to content

Commit

Permalink
openshift: fix bug in set_quota
Browse files Browse the repository at this point in the history
The OpenShift set_quota function was skipping quota values if they
evaluated to false. This updates the function to include quota values as
long as they're not None which allows for 0 values to be set.
  • Loading branch information
jtriley committed Nov 27, 2023
1 parent 50ae320 commit e4c2aaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coldfront_plugin_cloud/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def set_quota(self, project_id):
url = f"{self.auth_url}/projects/{project_id}/quota"
payload = dict()
for key, func in QUOTA_KEY_MAPPING.items():
if x := self.allocation.get_attribute(key):
if (x := self.allocation.get_attribute(key)) is not None:
payload.update(func(x))
r = self.session.put(url, data=json.dumps({'Quota': payload}))
self.check_response(r)
Expand Down

0 comments on commit e4c2aaa

Please sign in to comment.