File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from dataclasses import dataclass
2+
3+ import process_report .invoices .invoice as invoice
4+
5+
6+ @dataclass
7+ class OcpTestInvoice (invoice .Invoice ):
8+ export_columns_list = [
9+ invoice .INVOICE_DATE_FIELD ,
10+ invoice .PROJECT_FIELD ,
11+ invoice .PROJECT_ID_FIELD ,
12+ invoice .PI_FIELD ,
13+ invoice .INVOICE_EMAIL_FIELD ,
14+ invoice .INVOICE_ADDRESS_FIELD ,
15+ invoice .INSTITUTION_FIELD ,
16+ invoice .INSTITUTION_ID_FIELD ,
17+ invoice .SU_HOURS_FIELD ,
18+ invoice .SU_TYPE_FIELD ,
19+ invoice .RATE_FIELD ,
20+ invoice .COST_FIELD ,
21+ ]
22+
23+ def _prepare_export (self ):
24+ self .export_data = self .data [
25+ self .data [invoice .CLUSTER_NAME_FIELD ] == "ocp-test"
26+ ]
Original file line number Diff line number Diff line change 1919 pi_specific_invoice ,
2020 MOCA_prepaid_invoice ,
2121 prepay_credits_snapshot ,
22+ ocp_test_invoice ,
2223)
2324from process_report .processors import (
2425 coldfront_fetch_processor ,
@@ -201,6 +202,12 @@ def main():
201202 default = "Lenovo" ,
202203 help = "Name of output csv for Lenovo SU Types invoice" ,
203204 )
205+ parser .add_argument (
206+ "--ocp-test-file" ,
207+ required = False ,
208+ default = "OCP-TEST" ,
209+ help = "Name of output csv for Openshift test cluster invoice" ,
210+ )
204211 parser .add_argument (
205212 "--old-pi-file" ,
206213 required = False ,
@@ -384,6 +391,10 @@ def main():
384391 prepay_contacts = prepay_info ,
385392 )
386393
394+ ocp_test_inv = ocp_test_invoice .OcpTestInvoice (
395+ name = "" , invoice_month = invoice_month , data = processed_data .copy ()
396+ )
397+
387398 util .process_and_export_invoices (
388399 [
389400 lenovo_inv ,
@@ -394,6 +405,7 @@ def main():
394405 pi_inv ,
395406 moca_prepaid_inv ,
396407 prepay_credits_snap ,
408+ ocp_test_inv ,
397409 ],
398410 args .upload_to_s3 ,
399411 )
You can’t perform that action at this time.
0 commit comments