Skip to content

TPT-4551: Only get obj quota usage when has_usage is true#825

Merged
zliang-akamai merged 6 commits into
devfrom
zhiwei/obj-quota-has-usage
Jul 15, 2026
Merged

TPT-4551: Only get obj quota usage when has_usage is true#825
zliang-akamai merged 6 commits into
devfrom
zhiwei/obj-quota-has-usage

Conversation

@zliang-akamai

Copy link
Copy Markdown
Member

📝 Description

Keep the behavior consistent with the global quota modules. Only to get and return the usage when has_usage is true.

✔️ How to Test

make integration-test TEST_SUITE=object_storage_quota_info

@zliang-akamai
zliang-akamai requested review from a team as code owners July 14, 2026 03:15
@zliang-akamai
zliang-akamai requested review from jbilskiAkam and mawilk90 and removed request for a team July 14, 2026 03:15
@mawilk90
mawilk90 requested review from yec-akamai and removed request for jbilskiAkam July 15, 2026 09:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the object_storage_quota_info info module to only fetch/return quota usage when the API indicates usage is available (has_usage), aligning behavior with other quota-style modules and preventing unnecessary usage lookups.

Changes:

  • Add conditional usage retrieval so quota_usage is only fetched when has_usage is true.
  • Update the object storage quota integration test assertion to tolerate quotas without usage.
  • Update Python tooling configuration (Black target versions, Pylint py-version).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
plugins/modules/object_storage_quota_info.py Adds a helper get_quota_usage and wires it into secondary results so usage is only retrieved when available.
tests/integration/targets/object_storage_quota_info/tasks/main.yaml Updates assertion logic to only require usage fields when has_usage is true.
pyproject.toml Adjusts formatter/linter Python version targeting (Black + Pylint).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/modules/object_storage_quota_info.py
Comment thread tests/integration/targets/object_storage_quota_info/tasks/main.yaml Outdated
Comment thread pyproject.toml
@zliang-akamai
zliang-akamai merged commit 0f34465 into dev Jul 15, 2026
17 checks passed
@ezilber-akamai ezilber-akamai added the bugfix for any bug fixes in the changelog. label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix for any bug fixes in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants