Closed knikolla closed 5 months ago
I'll update validate_allocations
to convert all existing Swift quotas to GiB
@knikolla Do you want me to rename variables that reference GB
appropriately? So QUOTA_OBJECT_GB
and GB_IN_BYTES
will be QUOTA_OBJECT_GiB
and GiB_IN_BYTES
. This may make a very messy diff?
I'll update
validate_allocations
to convert all existing Swift quotas to GB
Don't do this as part of validate_allocations as that will introduce more complications. The reason why it would be more complicated like this, is because get_quota
will round to the nearest GB, so we would have to break one abstraction layer to get the actual value.
Create a new one-off command that will be called once to do the conversion, calling set_quota for only swift with the new values for all active/expired allocations on OpenStack.
Do you want me to rename variables that reference GB appropriately? So QUOTA_OBJECT_GB and GB_IN_BYTES will be QUOTA_OBJECT_GiB and GiB_IN_BYTES. This may make a very messy diff?
Keep the underlying variable name the same, however introduce a new attribute name migration (similar to #163 ) that renames the attribute to a similar naming scheme.
@knikolla Sorry for the late response. I see. I'll make a one-time command convert_swift_quota_to_gib.py
then. Do you think it would be worth it to do an "informal check" to see if a Swift quota is in Gb or Gib? By that I mean...
Right now, given the current code, I assume that all of our Swift quotas are in quantities that are divisible by 1000^2. After the conversion from Gb to Gib, we can still do checks in the future to see if any Swift quotas were (inadvertently or not) set in Gb or Gib by seeing if they're divisible by 1,000^2 or 1024^2. This would make the command not a one-time thing?
@QuanMPhm can you link the PR here please.
@knikolla Sorry for the late response. I see. I'll make a one-time command
convert_swift_quota_to_gib.py
then. Do you think it would be worth it to do an "informal check" to see if a Swift quota is in Gb or Gib? By that I mean...Right now, given the current code, I assume that all of our Swift quotas are in quantities that are divisible by 1000^2. After the conversion from Gb to Gib, we can still do checks in the future to see if any Swift quotas were (inadvertently or not) set in Gb or Gib by seeing if they're divisible by 1,000^2 or 1024^2. This would make the command not a one-time thing?
I don't think those checks are necessary.
@QuanMPhm can you link the PR here please.
I'm sorry. I'm encountering a problem with running VMs on my computer, and it's taking an absurd amount of time
10**9 = 1,000,000,000
to2**30 = 1,073,741,824
.validate_allocations
to set the new values on the allocations.Related https://github.com/nerc-project/operations/issues/587