qontract-reconcile 0.10.2.dev56__py3-none-any.whl → 0.10.2.dev57__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qontract-reconcile
3
- Version: 0.10.2.dev56
3
+ Version: 0.10.2.dev57
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Project-URL: homepage, https://github.com/app-sre/qontract-reconcile
6
6
  Project-URL: repository, https://github.com/app-sre/qontract-reconcile
@@ -15,7 +15,7 @@ reconcile/closedbox_endpoint_monitoring_base.py,sha256=MvGKBqH9PdHWdMjhLuptze-dk
15
15
  reconcile/cluster_deployment_mapper.py,sha256=5gumAaRCcFXsabUJ1dnuUy9WrP_FEEM5JnOnE8ch9sE,2326
16
16
  reconcile/dashdotdb_base.py,sha256=83ZWIf5JJk3P_D69y2TmXRcQr6ELJGlv10OM0h7fJVs,4767
17
17
  reconcile/dashdotdb_cso.py,sha256=QRK0YfIqO4rehs8btD3l_GXIO2ZIycTQEKEthBdB0xA,3639
18
- reconcile/dashdotdb_dora.py,sha256=olQnGp4JYpoh1lQEf9kHc2y3bMaAIUXEB6eFohWH8Io,17859
18
+ reconcile/dashdotdb_dora.py,sha256=ZOIIyxuwSrv33L7FZAHiKHPWDNnA1FybaUf37Lsk07A,17736
19
19
  reconcile/dashdotdb_dvo.py,sha256=lCkZ0iby6HrNQb-3kYb6xrt8wCjVUZYxKzz9SiStfHU,8946
20
20
  reconcile/dashdotdb_slo.py,sha256=PU1GzT6Uy07IIO3Y62cFfRfaBJYUPrMkMp71Up80_bg,8334
21
21
  reconcile/database_access_manager.py,sha256=Z3aAmw2LsmMIIor-bOGzziVZdVNC82Gmw8oHBUAFf-8,25577
@@ -30,7 +30,7 @@ reconcile/github_repo_permissions_validator.py,sha256=dcbXdUx6imjNchjp3pg9-z1i7l
30
30
  reconcile/github_users.py,sha256=nfTq78QRONIfDVj-5O3bD6psllJjzWFnog-EJ1WqFPU,3672
31
31
  reconcile/github_validator.py,sha256=cVTVxJIGR4a1Jz8wrdXEAb_CMpXUzvykVmUURX4cook,917
32
32
  reconcile/gitlab_fork_compliance.py,sha256=c7UfqSAsW04c1bWJmXXaQDwtUcG4Kb6nCJAyRU2uAuw,4449
33
- reconcile/gitlab_housekeeping.py,sha256=Gy1mhn33xGp9IyQFqs4VrBmhwJBD6x90XITDR_pU4MU,25416
33
+ reconcile/gitlab_housekeeping.py,sha256=i4hNZViV2yfUTDNsYhVSLik211q8_c4nbTK8ilmpufc,25313
34
34
  reconcile/gitlab_labeler.py,sha256=4xJHmVX155fclrHqkR926sL1GH6RTN5XfZ8PnqNXbRA,4534
35
35
  reconcile/gitlab_members.py,sha256=MUIgYDLeJx2-_vMypyq2Pa17cpKdXATYhtVACS2ghpQ,8297
36
36
  reconcile/gitlab_mr_sqs_consumer.py,sha256=O46mdziPgGOndbU-0_UJKJVUaiEoVzJPEgKm4_UvYoI,2571
@@ -115,11 +115,11 @@ reconcile/terraform_cloudflare_resources.py,sha256=pq8Ieo5NmB-dYQ9X2F0s6iEoINMzh
115
115
  reconcile/terraform_cloudflare_users.py,sha256=-dCJZqpZH1vD_Gri9QAZbqpKWiN-tsSWllIp0JuZ_-M,13938
116
116
  reconcile/terraform_repo.py,sha256=xHk0-7wgZchh_eqI-7oX4br9pYkKvYa6m7-8VPWqiZ4,15777
117
117
  reconcile/terraform_resources.py,sha256=iufjMJs_aSEvmh7Cg11beCxKmV8nrOLOpEtiTryPNx0,19470
118
- reconcile/terraform_tgw_attachments.py,sha256=-x7OV5fBmTh9t3N8f4t-AnvQozU1kQUxWKwVzk4GWWM,18838
118
+ reconcile/terraform_tgw_attachments.py,sha256=09svJG9pAiwWp4aY0xRoQRV90T4ZNwHG3r8flI-ZS_s,18810
119
119
  reconcile/terraform_users.py,sha256=rt62m9Yb0mkyhza07t_c6vlrFWF-OeJGJ9oGaCVK72M,10234
120
- reconcile/terraform_vpc_peerings.py,sha256=0N7uxG6Afe2oNrUyw-apjV-fX2P9TbI5A3xjXO_83eA,27658
120
+ reconcile/terraform_vpc_peerings.py,sha256=pDJkUFnAhEz2cNKEUY4WAJYK-09YPrNSSpt8BnIW3hc,27651
121
121
  reconcile/vault_replication.py,sha256=YD70ROZXC1dYnUcS3q1WgnAoIDSdoZVdZsUGc5fanNU,17556
122
- reconcile/vpc_peerings_validator.py,sha256=aESqrhm1tpkc2iqSL1UV5to_HjNgjRSffD0crb_q49g,7113
122
+ reconcile/vpc_peerings_validator.py,sha256=-upvNg3ggKCxcJ4kqZcqJVsiltlhQ8MyyLZiWX8eYmE,7068
123
123
  reconcile/aus/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
124
124
  reconcile/aus/advanced_upgrade_service.py,sha256=NF3UQ02MdUpVPup50EqnTbTn3dRHGoXoSfFLZxOjr8Q,23744
125
125
  reconcile/aus/aus_label_source.py,sha256=2Rktyvs7ZvCwsRwmbGUhddycTBTq0jHq8wpBaiDHAMA,4165
@@ -149,7 +149,7 @@ reconcile/aws_account_manager/utils.py,sha256=iYPPOtbZ7FiKkz9v5f1YXRIHw5YFOtSavU
149
149
  reconcile/aws_ami_cleanup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
150
150
  reconcile/aws_ami_cleanup/integration.py,sha256=KG7g9NpbKmoaveDD3oi9SinqUE29NaM-4lGo-6YuHlM,9302
151
151
  reconcile/aws_cloudwatch_log_retention/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
152
- reconcile/aws_cloudwatch_log_retention/integration.py,sha256=qVggTjGwP_6xTCXo2o3brSPtjwArNhZiGPy8YiBrCMM,7779
152
+ reconcile/aws_cloudwatch_log_retention/integration.py,sha256=p3ERapK2aJXTQ76tyGDORUn0r-dNtggNflcfP0Hi7RQ,7773
153
153
  reconcile/aws_saml_idp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
154
154
  reconcile/aws_saml_idp/integration.py,sha256=Z2JtUx2YIbkn0KVrVa2CoAErPB8vTykOOkWD_ZPoB94,6511
155
155
  reconcile/aws_saml_roles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -564,31 +564,32 @@ reconcile/typed_queries/terraform_tgw_attachments/aws_accounts.py,sha256=2idUmpa
564
564
  reconcile/unleash_feature_toggles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
565
565
  reconcile/unleash_feature_toggles/integration.py,sha256=nx7BhtzCsTfPbOp60vI5MkNwuj8QrPay52msjADLbfI,10995
566
566
  reconcile/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
567
- reconcile/utils/aggregated_list.py,sha256=_9UeaS1TWbJsGIESvXlzzK-omPI2lMMcCsoqc9LBclc,4022
567
+ reconcile/utils/aggregated_list.py,sha256=km0xadW0jO4G_CqZPsXmoBURQ8c90FaTu5x4X1K1cZs,3357
568
568
  reconcile/utils/amtool.py,sha256=3dHViQ_esKPaMEpiOVVSnxTaySM8ELpGVVvppqqPvUY,2289
569
- reconcile/utils/aws_api.py,sha256=n2HMUPOnztcDt7c8GvGpT0qrpwArXke0hSCHQ1dSk6w,79439
570
- reconcile/utils/aws_helper.py,sha256=8PvDR17ntAGX3bBzlTIxDuENl2rkK-RECsNYKm2_DZw,2955
569
+ reconcile/utils/aws_api.py,sha256=cyX3NYe035CyX2ZyVmjWl_jcFCAm-SA_T34NUt9brW0,67901
570
+ reconcile/utils/aws_helper.py,sha256=IOfPpNB0Hh73oo8pWozeril7YH_EJRCdYhahFp-esns,2871
571
571
  reconcile/utils/batches.py,sha256=TtEm64a8lWhFuNbUVpFEmXVdU2Q0sTBrP_I0Cjbgh7g,320
572
- reconcile/utils/binary.py,sha256=lSIevhilMeoGMePPHD7A-pxe45LVpBT0LksecYbM-EA,2477
573
- reconcile/utils/config.py,sha256=UhF9U6A0TLmoPTGwhOclUKcSEChu5_Gqwm8VTM1X0ow,1156
572
+ reconcile/utils/binary.py,sha256=V6fW70wGFMCaYaLjJ0A-C_U3p7THTcAmv4wN_KP__KU,2207
573
+ reconcile/utils/config.py,sha256=kwaAaNBQ9z-fsDJu2-WZFgTnL6HKd3FPjiu0mbriHkg,1004
574
574
  reconcile/utils/constants.py,sha256=pOUd97bqZdsAu5RWJ8NUs9cwCY7K9y0eW9VVeJ4fZIU,138
575
+ reconcile/utils/data_structures.py,sha256=VyKfnlNJTiRvZKNpfgIrjESQ2YgmEpWuPQXT14WA1vI,311
575
576
  reconcile/utils/deadmanssnitch_api.py,sha256=0uajXxRNUEyF8CPTYPFNV4G-_3KB_hDF9L8OtTy2zCk,2476
576
- reconcile/utils/defer.py,sha256=LYTqcvyifCg71_C2i7pbxdqd8-NrXrUhcvuLFy1bQN0,476
577
+ reconcile/utils/defer.py,sha256=SniUsbgOEs9Pa8JkecLu0F94O63yQPByKXaElDYe0FI,377
577
578
  reconcile/utils/differ.py,sha256=WFW8GoFPMEw9TD1irPpIan6aILF-kjeWWsKLuvqnv64,7554
578
579
  reconcile/utils/disabled_integrations.py,sha256=z1ZGUOKjZ99R-YZ68w1xnLQ_wUccI27NcmdzfK9TARs,1077
579
580
  reconcile/utils/dnsutils.py,sha256=Zit4U-DAt_6AD4NVvic3I7EO5DdjNEeu8Qn_x84i-44,258
580
581
  reconcile/utils/early_exit_cache.py,sha256=9zj4ksXCq2qK2oGO0zW9aZ5tkjC5sRCms0ismZOmBv4,8725
581
- reconcile/utils/elasticsearch_exceptions.py,sha256=4lwms6yjDYJzhD_xXgb96Juax5DHp_LXEUaME6t59A4,578
582
- reconcile/utils/environ.py,sha256=j43kXnqE9uVg__N-83HpcWUqv1Q8ge8ykTL3OnVs-yc,653
583
- reconcile/utils/exceptions.py,sha256=2cKJD01d_uZM_j0CTcvDoo-WDisZJVYaeY2KUbfUHCc,686
582
+ reconcile/utils/elasticsearch_exceptions.py,sha256=zMuP0B8Y3U0u64ZrmAyzw2RWALPs9uS7IzKcF7Prx0U,501
583
+ reconcile/utils/environ.py,sha256=psk07d2xyjbUzjOCDdNWgavaNolL_t2sq3sn2gFfY9k,507
584
+ reconcile/utils/exceptions.py,sha256=DwfnWUpVOotpP79RWZ2pycmG6nKCL00RBIeZLYkQPW4,635
584
585
  reconcile/utils/expiration.py,sha256=3JaXH4psksR7z262k7FmdyREjCLqm66OpVMEbcfdWRo,1213
585
586
  reconcile/utils/extended_early_exit.py,sha256=QSktrmfw37zSRMNk930tDbQsVeKxaPPPD43e79DGwZw,6754
586
587
  reconcile/utils/external_resource_spec.py,sha256=qeupz4t4trd2uPjlHjf_AFA9Y-EKrMnaXi72tAuCxig,7177
587
588
  reconcile/utils/external_resources.py,sha256=YzTb0xAcNdmKO326mGQy7BmST56CZcdru4lX7ai_7kw,7579
588
589
  reconcile/utils/filtering.py,sha256=S4PbMHuFr3ED0P2Q_ea5CAaB7FimI62B-F5YTaKrphA,402
589
- reconcile/utils/git.py,sha256=o4p9m8jlzCJDcutl2HErvGLhL6sZ1NB4Aw3zGcQIzso,2427
590
+ reconcile/utils/git.py,sha256=wzVIYAeKlMGW538U1mkJWUI6h_mFRUY4lawh2AR8hw4,2345
590
591
  reconcile/utils/github_api.py,sha256=y3fxty7FKvfhdzfHgGSaIstL6A_Y2loUcMiyIK5TMDg,2750
591
- reconcile/utils/gitlab_api.py,sha256=WMTNXtldW0L9qhC0rfd3ssGeHu9khmzU1RBG6lZHpQM,29723
592
+ reconcile/utils/gitlab_api.py,sha256=N1QdgF6Jdhg_nF03vtfouvqXP7MVfkPRnq7Q3z169kM,28662
592
593
  reconcile/utils/gpg.py,sha256=EKG7_fdMv8BMlV5yUdPiqoTx-KrzmVSEAl2sLkaKwWI,1123
593
594
  reconcile/utils/gql.py,sha256=C0thIm_k9MBldfqwHzyqtYZk9sIvMdm9IbbnXLGwjD8,14158
594
595
  reconcile/utils/grouping.py,sha256=vr9SFHZ7bqmHYrvYcEZt-Er3-yQYfAAdq5sHLZVmXPY,456
@@ -642,7 +643,7 @@ reconcile/utils/three_way_diff_strategy.py,sha256=oQcHXd9LVhirJfoaOBoHUYuZVGfyL2
642
643
  reconcile/utils/throughput.py,sha256=iP4UWAe2LVhDo69mPPmgo9nQ7RxHD6_GS8MZe-aSiuM,344
643
644
  reconcile/utils/vault.py,sha256=aSA8l9cJlPUHpChFGl27nSY-Mpq9FMjBo7Dcgb1BVfM,15036
644
645
  reconcile/utils/vaultsecretref.py,sha256=0KUSzuvTRxPyKY919TO3-B_eYg4_76fzKvMF8j5s1G0,911
645
- reconcile/utils/vcs.py,sha256=fcNwWlhrknxg3QUs8BZ23wxTe3ISS7GFZxwFUZZG-wg,8718
646
+ reconcile/utils/vcs.py,sha256=4_f08Rixb1NcLdWI0vh8e-B0Cb4ckx1bd0TkLqCmvR4,8674
646
647
  reconcile/utils/acs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
647
648
  reconcile/utils/acs/base.py,sha256=4UsDrCpAOuddL3PKNuIQYoJP1BtZQNNB8_KEX0lXneg,2532
648
649
  reconcile/utils/acs/notifiers.py,sha256=nHVw9C_2-K4nv5zq26jlOTSw1roY6TKlovi1sOfpxpI,4998
@@ -690,7 +691,7 @@ reconcile/utils/mr/__init__.py,sha256=hcfHDIIIsJT4C0BnzDnyeZEfZdamrqHzMLcBzIT1ib
690
691
  reconcile/utils/mr/app_interface_reporter.py,sha256=6Kpg93V9FvcOke9Jimkva359MQ-ZyBIkUpf8QIA6-to,1793
691
692
  reconcile/utils/mr/app_sre_tekton_access_report.py,sha256=i7JeTkyaq0HyVGbAFKCNbiLy3NVE05IXqJzwArsGre4,1513
692
693
  reconcile/utils/mr/aws_access.py,sha256=9MMpYD24j2lLr_hLeMSh_OsJ07waalrlNpz-JlOsKAM,2575
693
- reconcile/utils/mr/base.py,sha256=pHRmyxJzlBy9ldjYKOdHg9-9KbsK8bdRScntKZa5Tew,8130
694
+ reconcile/utils/mr/base.py,sha256=O8BWr6dibeQ22FDE9y56r6DK3UnC-5IhRXT7IWGrnxk,8069
694
695
  reconcile/utils/mr/clusters_updates.py,sha256=pcusPAwRUkvyk_-bixsRNTzSvpTLypJ1kflq5UEVgcM,2271
695
696
  reconcile/utils/mr/glitchtip_access_reporter.py,sha256=cTkOtzdgeKPaqro0VS2hDuAClQiN4nZATh-mplQC-AI,1369
696
697
  reconcile/utils/mr/labels.py,sha256=9QRTRjZAtq45zELd9SwavaraczMjwjn5no3RK1YxFTg,825
@@ -698,7 +699,7 @@ reconcile/utils/mr/notificator.py,sha256=f8IcGQ1_iBsXJFnhPsWQ7UE3NfigaOrXcVieJPp
698
699
  reconcile/utils/mr/ocm_update_recommended_version.py,sha256=p_aVP0TGrlKk9WBwgQnYWqUDsED_Hg6G5Bqj0UvtRwA,1536
699
700
  reconcile/utils/mr/ocm_upgrade_scheduler_org_updates.py,sha256=5EncHGr4QRnZgHedRfCwMYZ9CaijYzHGj7-M6lhtQRo,3004
700
701
  reconcile/utils/mr/promote_qontract.py,sha256=wgvX2CBlcZaihKJSXJ0zcEK8NGaEP2_DUQDz0STzGes,7158
701
- reconcile/utils/mr/update_access_report_base.py,sha256=4Grohtp44v1sSHZyIAYOwClxH8SLj_nnOrCcHPKp9p0,4361
702
+ reconcile/utils/mr/update_access_report_base.py,sha256=0vhF-eZTIjl7keBAOb2bO7LrlRAiticuUGh5EmI5MWc,4357
702
703
  reconcile/utils/mr/user_maintenance.py,sha256=ZlR1Id_r2BUXsoerJW-0Ioh5bcbwlnQxBBhSs-ri9Dk,5099
703
704
  reconcile/utils/ocm/__init__.py,sha256=Y-bp8GomMpyCo0tFW6kJ78-ZG1UIupYRtBzbMWU0kwM,798
704
705
  reconcile/utils/ocm/addons.py,sha256=_LDdJ-gapM3s5exKlIUt-MlXZTAUoHezbYBU0QmvfWQ,7335
@@ -750,7 +751,7 @@ tools/app_sre_tekton_access_reporter.py,sha256=o9prLUgQpwO3msRWc2as1xT1y9OB3znkp
750
751
  tools/app_sre_tekton_access_revalidation.py,sha256=66nHEaY-bIqxIhpcmwN8AvQZu6ZXenfkg4Fut0pVZRM,2726
751
752
  tools/glitchtip_access_reporter.py,sha256=o01A6b88t3Wie6tj_tJWWVo2J01LxQ_a9giGm4UzEaU,2901
752
753
  tools/glitchtip_access_revalidation.py,sha256=8kbBJk04mkq28kWoRDDkfCGIF3GRg3pJrFAh1sW0dbk,2821
753
- tools/qontract_cli.py,sha256=HAN-3m8udB8Ea1B4fIpmJoJjLWQERDhIF-9LU9XBCnQ,152477
754
+ tools/qontract_cli.py,sha256=85CWZ6cxprlZ57408tqhCzpj_jvLhiJgbPlFwI-V1Jo,152244
754
755
  tools/sd_app_sre_alert_report.py,sha256=jQpJdXVID68bSNtJNOGDh0-ei1CfEUS4Itr4MAaBNFA,5062
755
756
  tools/template_validation.py,sha256=qpKYaTgk0GOPGa2Ct5_5sKdwIHtCAKIBGzsMPuJU5fw,3371
756
757
  tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -777,7 +778,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
777
778
  tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
778
779
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
779
780
  tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
780
- qontract_reconcile-0.10.2.dev56.dist-info/METADATA,sha256=kWky6Hw9eg7YODzjcwI6GeUg7BUdpELD6uvYOH6ByOQ,24665
781
- qontract_reconcile-0.10.2.dev56.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
782
- qontract_reconcile-0.10.2.dev56.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
783
- qontract_reconcile-0.10.2.dev56.dist-info/RECORD,,
781
+ qontract_reconcile-0.10.2.dev57.dist-info/METADATA,sha256=2qGhxgrqphXjBqRFzFHynTsQErFrGX6JcXRGzKPRwc4,24665
782
+ qontract_reconcile-0.10.2.dev57.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
783
+ qontract_reconcile-0.10.2.dev57.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
784
+ qontract_reconcile-0.10.2.dev57.dist-info/RECORD,,
@@ -3,7 +3,10 @@ import re
3
3
  import typing
4
4
  from collections import defaultdict
5
5
  from collections.abc import Iterable
6
- from datetime import UTC, datetime, timedelta
6
+ from datetime import (
7
+ datetime,
8
+ timedelta,
9
+ )
7
10
  from enum import Enum
8
11
  from typing import TYPE_CHECKING
9
12
 
@@ -15,9 +18,9 @@ from reconcile.queries import get_aws_accounts
15
18
  from reconcile.utils.aws_api import AWSApi
16
19
 
17
20
  if TYPE_CHECKING:
18
- from mypy_boto3_logs.type_defs import LogGroupTypeDef
21
+ from mypy_boto3_logs import CloudWatchLogsClient # type: ignore
19
22
  else:
20
- LogGroupTypeDef = object
23
+ CloudWatchLogsClient = object
21
24
 
22
25
  QONTRACT_INTEGRATION = "aws_cloudwatch_log_retention"
23
26
  MANAGED_BY_INTEGRATION_KEY = "managed_by_integration"
@@ -66,17 +69,21 @@ def create_awsapi_client(accounts: list, thread_pool_size: int) -> AWSApi:
66
69
  return AWSApi(thread_pool_size, accounts, settings=settings, init_users=False)
67
70
 
68
71
 
69
- def is_empty(log_group: LogGroupTypeDef) -> bool:
72
+ def is_empty(
73
+ log_group: dict,
74
+ ) -> bool:
70
75
  return log_group["storedBytes"] == 0
71
76
 
72
77
 
73
78
  def is_longer_than_retention(
74
- log_group: LogGroupTypeDef,
79
+ log_group: dict,
75
80
  desired_retention_days: int,
76
81
  ) -> bool:
77
- return datetime.fromtimestamp(log_group["creationTime"] / 1000, tz=UTC) + timedelta(
78
- days=desired_retention_days
79
- ) < datetime.now(tz=UTC)
82
+ return (
83
+ datetime.fromtimestamp(log_group["creationTime"] / 1000)
84
+ + timedelta(days=desired_retention_days)
85
+ < datetime.utcnow()
86
+ )
80
87
 
81
88
 
82
89
  class TagStatus(Enum):
@@ -86,7 +93,7 @@ class TagStatus(Enum):
86
93
 
87
94
 
88
95
  def get_tag_status(
89
- log_group: LogGroupTypeDef,
96
+ log_group: dict,
90
97
  account_name: str,
91
98
  region: str,
92
99
  aws_api: AWSApi,
@@ -106,7 +113,7 @@ def get_tag_status(
106
113
 
107
114
  def _reconcile_log_group(
108
115
  dry_run: bool,
109
- aws_log_group: LogGroupTypeDef,
116
+ aws_log_group: dict,
110
117
  desired_cleanup_options: Iterable[AWSCloudwatchCleanupOption],
111
118
  account_name: str,
112
119
  region: str,
@@ -397,11 +397,10 @@ class DashdotdbDORA(DashdotdbBase):
397
397
  self, saastarget: SaasTarget, sha: str
398
398
  ) -> tuple[str | None, str | None]:
399
399
  try:
400
- saas_file_yaml = self.gl_app_interface_get_file(saastarget.path, ref=sha)
401
- if not saas_file_yaml:
402
- LOG.info(f"failed to fetch saas file {saastarget.path} at {sha}")
403
- return (None, None)
404
- saas_file = yaml.safe_load(saas_file_yaml.decode())
400
+ saas_file_yaml = self.gl_app_interface_get_file(
401
+ saastarget.path, ref=sha
402
+ ).decode()
403
+ saas_file = yaml.safe_load(saas_file_yaml)
405
404
  except Exception as e:
406
405
  LOG.info(f"failed to decode saas file {saastarget.path} with error: {e}")
407
406
  return (None, None)
@@ -11,11 +11,10 @@ from datetime import (
11
11
  timedelta,
12
12
  )
13
13
  from operator import itemgetter
14
- from typing import Any, cast
14
+ from typing import Any
15
15
 
16
16
  import gitlab
17
17
  from gitlab.v4.objects import (
18
- ProjectCommit,
19
18
  ProjectIssue,
20
19
  ProjectMergeRequest,
21
20
  )
@@ -336,15 +335,12 @@ def is_good_to_merge(labels):
336
335
 
337
336
  def is_rebased(mr, gl: GitLabApi) -> bool:
338
337
  target_branch = mr.target_branch
339
- head = cast(
340
- list[ProjectCommit],
341
- gl.project.commits.list(
342
- ref_name=target_branch,
343
- per_page=1,
344
- page=1,
345
- ),
338
+ head = gl.project.commits.list(
339
+ ref_name=target_branch,
340
+ per_page=1,
341
+ page=1,
346
342
  )[0].id
347
- result = cast(dict, gl.project.repository_compare(mr.sha, head))
343
+ result = gl.project.repository_compare(mr.sha, head)
348
344
  return len(result["commits"]) == 0
349
345
 
350
346
 
@@ -195,9 +195,9 @@ def _build_desired_state_tgw_connection(
195
195
  cluster_region,
196
196
  cluster_cidr_block,
197
197
  tags=peer_connection.tags or {},
198
- route_tables=bool(peer_connection.manage_routes),
199
- security_groups=bool(peer_connection.manage_security_groups),
200
- route53_associations=bool(peer_connection.manage_route53_associations),
198
+ route_tables=peer_connection.manage_routes,
199
+ security_groups=peer_connection.manage_security_groups,
200
+ route53_associations=peer_connection.manage_route53_associations,
201
201
  )
202
202
  for tgw in account_tgws:
203
203
  connection_name = (
@@ -268,13 +268,13 @@ def _build_accepter(
268
268
  awsapi: AWSApi,
269
269
  private_hcp: bool = False,
270
270
  ) -> Accepter:
271
- allow_hcp_private_api_access = bool(
271
+ allow_hcp_private_api_access = (
272
272
  private_hcp and peer_connection.allow_private_hcp_api_access
273
273
  )
274
274
  (vpc_id, route_table_ids, subnets_id_az, api_security_group_id) = (
275
275
  awsapi.get_cluster_vpc_details(
276
276
  account.dict(by_alias=True),
277
- route_tables=bool(peer_connection.manage_routes),
277
+ route_tables=peer_connection.manage_routes,
278
278
  subnets=True,
279
279
  hcp_vpc_endpoint_sg=allow_hcp_private_api_access,
280
280
  )
@@ -198,7 +198,7 @@ def build_desired_state_single_cluster(
198
198
  f"{peer_connection_name}"
199
199
  )
200
200
 
201
- accepter_manage_routes = peer_info.get("manageRoutes", False)
201
+ accepter_manage_routes = peer_info.get("manageRoutes")
202
202
 
203
203
  infra_account_name, req_aws, acc_aws = aws_assume_roles_for_cluster_vpc_peering(
204
204
  peer_connection, cluster_info, peer_info, peer_cluster, ocm
@@ -1,27 +1,17 @@
1
1
  import json
2
2
  import logging
3
- from collections.abc import Callable, KeysView
4
- from typing import Any, TypedDict
5
-
6
- Action = Callable[[Any, list[Any]], bool]
7
- Cond = Callable[[Any], bool]
8
3
 
9
4
 
10
5
  class RunnerException(Exception):
11
6
  pass
12
7
 
13
8
 
14
- class AggregatedItem(TypedDict):
15
- params: Any
16
- items: list[Any]
17
-
18
-
19
9
  class AggregatedList:
20
- def __init__(self) -> None:
21
- self._dict: dict[int, AggregatedItem] = {}
10
+ def __init__(self):
11
+ self._dict = {}
22
12
 
23
- def add(self, params: Any, new_items: Any | list[Any]) -> None:
24
- params_hash: int = self.hash_params(params)
13
+ def add(self, params, new_items):
14
+ params_hash = self.hash_params(params)
25
15
 
26
16
  if self._dict.get(params_hash) is None:
27
17
  self._dict[params_hash] = {"params": params, "items": []}
@@ -33,20 +23,20 @@ class AggregatedList:
33
23
  if item not in self._dict[params_hash]["items"]:
34
24
  self._dict[params_hash]["items"].append(item)
35
25
 
36
- def get(self, params: Any) -> AggregatedItem:
26
+ def get(self, params):
37
27
  return self._dict[self.hash_params(params)]
38
28
 
39
- def get_all_params_hash(self) -> KeysView[int]:
29
+ def get_all_params_hash(self):
40
30
  return self._dict.keys()
41
31
 
42
- def get_by_params_hash(self, params_hash: int) -> AggregatedItem:
32
+ def get_by_params_hash(self, params_hash):
43
33
  return self._dict[params_hash]
44
34
 
45
- def diff(self, right_state: "AggregatedList") -> dict[str, list[AggregatedItem]]:
35
+ def diff(self, right_state):
46
36
  left_params = self.get_all_params_hash()
47
37
  right_params = right_state.get_all_params_hash()
48
38
 
49
- diff: dict[str, list[AggregatedItem]] = {
39
+ diff = {
50
40
  "insert": [
51
41
  right_state.get_by_params_hash(p)
52
42
  for p in right_params
@@ -62,11 +52,11 @@ class AggregatedList:
62
52
  union = [p for p in left_params if p in right_params]
63
53
 
64
54
  for p in union:
65
- left: AggregatedItem = self.get_by_params_hash(p)
66
- right: AggregatedItem = right_state.get_by_params_hash(p)
55
+ left = self.get_by_params_hash(p)
56
+ right = right_state.get_by_params_hash(p)
67
57
 
68
- l_items: list[Any] = left["items"]
69
- r_items: list[Any] = right["items"]
58
+ l_items = left["items"]
59
+ r_items = right["items"]
70
60
 
71
61
  update_insert = [i for i in r_items if i not in l_items]
72
62
  update_delete = [i for i in l_items if i not in r_items]
@@ -85,28 +75,28 @@ class AggregatedList:
85
75
 
86
76
  return diff
87
77
 
88
- def dump(self) -> list[AggregatedItem]:
78
+ def dump(self):
89
79
  return list(self._dict.values())
90
80
 
91
- def toJSON(self) -> str:
81
+ def toJSON(self):
92
82
  return json.dumps(self.dump(), indent=4)
93
83
 
94
84
  @staticmethod
95
- def hash_params(params: Any) -> int:
85
+ def hash_params(params):
96
86
  return hash(json.dumps(params, sort_keys=True))
97
87
 
98
88
 
99
89
  class AggregatedDiffRunner:
100
- def __init__(self, diff: dict[str, list[AggregatedItem]]) -> None:
90
+ def __init__(self, diff):
101
91
  self.diff = diff
102
- self.actions: list[tuple[str, Action, Cond | None]] = []
92
+ self.actions = []
103
93
 
104
- def register(self, on: str, action: Action, cond: Cond | None = None) -> None:
94
+ def register(self, on, action, cond=None):
105
95
  if on not in self.diff:
106
96
  raise Exception(f"Unknown diff key for 'on': {on}")
107
97
  self.actions.append((on, action, cond))
108
98
 
109
- def run(self) -> bool:
99
+ def run(self):
110
100
  status = True
111
101
 
112
102
  for on, action, cond in self.actions: