Skip to content

Commit

Permalink
.get method is wrong. Fixed according the JSON structure when fetchin…
Browse files Browse the repository at this point in the history
…g with AWSED
  • Loading branch information
trn024 committed Aug 29, 2024
1 parent bdd3773 commit 61b2aaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dsmlp/ext/awsed.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def get_user_gpu_quota(self, username: str) -> UserQuotaResponse:
usrGpuQuota = self.client.get_user_quota(username)
if not usrGpuQuota:
return None
gpu_quota = usrGpuQuota.get("nvidia.com/gpu", 0)
quota = Quota(user=username, resources=gpu_quota)
gpu_quota = usrGpuQuota['resources'].get("nvidia.com/gpu", 0) # Access the correct attribute
quota = Quota(user=username, resources={"nvidia.com/gpu": gpu_quota})
return UserQuotaResponse(quota=quota)
except Exception as e:
self.logger.error(f"Failed to fetch GPU quota for user {username}: {e}")
Expand Down

0 comments on commit 61b2aaa

Please sign in to comment.