@@ -113,16 +113,22 @@ def add_arguments(self, parser):
113113 help = "CSV file to write invoices to." ,
114114 )
115115 parser .add_argument (
116- "--openstack-gb-rate" ,
116+ "--openstack-nese- gb-rate" ,
117117 type = Decimal ,
118118 required = False ,
119- help = "Rate for OpenStack Volume and Object GB/hour." ,
119+ help = "Rate for OpenStack NESE Volume and Object GB/hour." ,
120120 )
121121 parser .add_argument (
122- "--openshift-gb-rate" ,
122+ "--openshift-nese- gb-rate" ,
123123 type = Decimal ,
124124 required = False ,
125- help = "Rate for OpenShift GB/hour." ,
125+ help = "Rate for OpenShift NESE Storage GB/hour." ,
126+ )
127+ parser .add_argument (
128+ "--openshift-ibm-gb-rate" ,
129+ type = Decimal ,
130+ required = False ,
131+ help = "Rate for OpenShift IBM Storage Scale GB/hour." ,
126132 )
127133 parser .add_argument (
128134 "--s3-endpoint-url" ,
@@ -248,23 +254,30 @@ def process_invoice_row(allocation, attrs, su_name, rate):
248254 resources__in = openshift_resources
249255 )
250256
251- if options ["openstack_gb_rate " ]:
252- openstack_storage_rate = options ["openstack_gb_rate " ]
257+ if options ["openstack_nese_gb_rate " ]:
258+ openstack_nese_storage_rate = options ["openstack_nese_gb_rate " ]
253259 else :
254- openstack_storage_rate = get_rates ().get_value_at (
260+ openstack_nese_storage_rate = get_rates ().get_value_at (
255261 "NESE Storage GB Rate" , options ["invoice_month" ], Decimal
256262 )
257263
258- if options ["openshift_gb_rate " ]:
259- openshift_storage_rate = options ["openshift_gb_rate " ]
264+ if options ["openshift_nese_gb_rate " ]:
265+ openshift_nese_storage_rate = options ["openshift_nese_gb_rate " ]
260266 else :
261- openshift_storage_rate = get_rates ().get_value_at (
267+ openshift_nese_storage_rate = get_rates ().get_value_at (
262268 "NESE Storage GB Rate" , options ["invoice_month" ], Decimal
263269 )
264270
271+ if options ["openshift_ibm_gb_rate" ]:
272+ openshift_ibm_storage_rate = options ["openshift_ibm_gb_rate" ]
273+ else :
274+ openshift_ibm_storage_rate = get_rates ().get_value_at (
275+ "IBM Spectrum Scale Storage GB Rate" , options ["invoice_month" ], Decimal
276+ )
277+
265278 logger .info (
266- f"Using storage rate { openstack_storage_rate } (Openstack) and "
267- f"{ openshift_storage_rate } (Openshift) for { options ['invoice_month' ]} "
279+ f"Using storage rate { openstack_nese_storage_rate } (Openstack NESE), { openshift_nese_storage_rate } (Openshift NESE), and "
280+ f"{ openshift_ibm_storage_rate } (Openshift IBM Scale ) for { options ['invoice_month' ]} "
268281 )
269282
270283 logger .info (f"Writing to { options ['output' ]} ." )
@@ -286,7 +299,7 @@ def process_invoice_row(allocation, attrs, su_name, rate):
286299 allocation ,
287300 [attributes .QUOTA_VOLUMES_GB , attributes .QUOTA_OBJECT_GB ],
288301 "OpenStack Storage" ,
289- openstack_storage_rate ,
302+ openstack_nese_storage_rate ,
290303 )
291304
292305 for allocation in openshift_allocations :
@@ -303,7 +316,14 @@ def process_invoice_row(allocation, attrs, su_name, rate):
303316 attributes .QUOTA_REQUESTS_NESE_STORAGE ,
304317 ],
305318 "OpenShift NESE Storage" ,
306- openshift_storage_rate ,
319+ openshift_nese_storage_rate ,
320+ )
321+
322+ process_invoice_row (
323+ allocation ,
324+ [attributes .QUOTA_REQUESTS_IBM_STORAGE ],
325+ "OpenShift IBM Scale Storage" ,
326+ openshift_ibm_storage_rate ,
307327 )
308328
309329 if options ["upload_to_s3" ]:
0 commit comments