Skip to content

Move hardcoded quota names from attributes.py to tests - #324

Open
marcoagonzales007 wants to merge 1 commit into
nerc-project:mainfrom
marcoagonzales007:remove-hardcoded-names
Open

Move hardcoded quota names from attributes.py to tests#324
marcoagonzales007 wants to merge 1 commit into
nerc-project:mainfrom
marcoagonzales007:remove-hardcoded-names

Conversation

@marcoagonzales007

Copy link
Copy Markdown

Fixes #298 (Migrated to CCI-MOC/MOC-issues#256) )

This moves the Quota_* constants into a test only module( tests/attributes.py) and refactors the remaining uses

  • openstack.py finds the Swift object quota by its object instead of by display name.

  • calculate_storage_gb_hours bills OpenShift storage from each resource's quota specs grouped by invoice_name, like the OpenStack loop already does.

  • register_default_quotas inlines the default display names it registers.

  • convert_swift_quota_to_gib also had a broken reference to the removed openstack.QUOTA_KEY_MAPPING

  • QUOTA_GPU stays in attributes.py because it's still a statically registered allocation attribute used by count_gpu_usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor the attributes.py to remove hardcoded quota names

1 participant