Skip to content

Commit c9f19f6

Browse files
committed
Explicitly request type when using nerc_rates
With the recent update to `nerc_rates` [1] which added type enforcement and requires users of `nerc_rates` to explicitly declare the requested type, our script has been updated to request the appropriate types. This should reduce ambiguity in the values we fetch from nerc_rates [1] CCI-MOC/nerc-rates#22
1 parent d776019 commit c9f19f6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
git+https://github.com/CCI-MOC/nerc-rates@74eb4a7#egg=nerc_rates
1+
git+https://github.com/CCI-MOC/nerc-rates@33701ed#egg=nerc_rates
22
boto3
33
kubernetes
44
openshift

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package_dir =
2020
packages = find:
2121
python_requires = >=3.11
2222
install_requires =
23-
nerc_rates @ git+https://github.com/CCI-MOC/nerc-rates@74eb4a7
23+
nerc_rates @ git+https://github.com/CCI-MOC/nerc-rates@33701ed
2424
boto3
2525
kubernetes
2626
openshift

src/coldfront_plugin_cloud/management/commands/calculate_storage_gb_hours.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,15 @@ def process_invoice_row(allocation, attrs, su_name, rate):
248248
if options["openstack_gb_rate"]:
249249
openstack_storage_rate = options["openstack_gb_rate"]
250250
else:
251-
openstack_storage_rate = Decimal(
252-
get_rates().get_value_at("Storage GB Rate", options["invoice_month"])
251+
openstack_storage_rate = get_rates().get_value_at(
252+
"Storage GB Rate", options["invoice_month"], Decimal
253253
)
254254

255255
if options["openshift_gb_rate"]:
256256
openshift_storage_rate = options["openshift_gb_rate"]
257257
else:
258-
openshift_storage_rate = Decimal(
259-
get_rates().get_value_at("Storage GB Rate", options["invoice_month"])
258+
openshift_storage_rate = get_rates().get_value_at(
259+
"Storage GB Rate", options["invoice_month"], Decimal
260260
)
261261

262262
logger.info(

0 commit comments

Comments
 (0)