qontract-reconcile 0.10.2.dev67__py3-none-any.whl → 0.10.2.dev69__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.dev67
3
+ Version: 0.10.2.dev69
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
@@ -142,7 +142,7 @@ reconcile/aus/version_gates/sts_version_gate_handler.py,sha256=swwwz0YyvrEBf_Inq
142
142
  reconcile/aws_account_manager/README.md,sha256=_XFM3GZNHUzv--e_navqJuaUWpjC6QrHfulreHynFf0,262
143
143
  reconcile/aws_account_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
144
144
  reconcile/aws_account_manager/integration.py,sha256=WOE_mi45pvJW4TNKh4mCGSViJiElH--T4Wg0CLMYxpY,14988
145
- reconcile/aws_account_manager/merge_request_manager.py,sha256=fz9s1VrBGHi0MdUR9D1Pqo7Q2lHlzbgzgYEE4kEYm9s,3950
145
+ reconcile/aws_account_manager/merge_request_manager.py,sha256=q8t-YwD4y_4UpxdoG9TQrEbDpjlzasOQIynFoCjP2OE,3947
146
146
  reconcile/aws_account_manager/metrics.py,sha256=YB10ea4kIGwJfs5N14RF-RoXPb-QQWaDBz1jLZ3YWE0,917
147
147
  reconcile/aws_account_manager/reconciler.py,sha256=8mwwcWVVNoUzmttzxgnLyePqN823v1t_dQCNCrx1mG0,15035
148
148
  reconcile/aws_account_manager/utils.py,sha256=iYPPOtbZ7FiKkz9v5f1YXRIHw5YFOtSavUkF8oMwfJY,1439
@@ -159,7 +159,7 @@ reconcile/aws_version_sync/integration.py,sha256=BUVUC90cNVjFPVpGKxGY9b9x-TRVHDE
159
159
  reconcile/aws_version_sync/utils.py,sha256=x-45QT7zAwdNvCg7w_qJNwLaksFcfz1_6KQoD_0IVuA,1727
160
160
  reconcile/aws_version_sync/merge_request_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
161
161
  reconcile/aws_version_sync/merge_request_manager/merge_request.py,sha256=2FbqLLdqxycWNvX1eNbwMjWSVBb7q0p-8t5Db0m7b4Q,4842
162
- reconcile/aws_version_sync/merge_request_manager/merge_request_manager.py,sha256=3bRpw7DluiYw3daRg0yAyCSGYf39Ru0d8lUjoepDSpU,5525
162
+ reconcile/aws_version_sync/merge_request_manager/merge_request_manager.py,sha256=7EwpSMsAYk41yEqb3uB_EjU73qqWeF28c7UTuQaNjUQ,5522
163
163
  reconcile/change_owners/README.md,sha256=NEXVw4SioTWTGo9elSQUjqY10RIUoisl4zkzEBvly8s,3946
164
164
  reconcile/change_owners/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
165
165
  reconcile/change_owners/approver.py,sha256=Z3_11vnK2WNOxjEEXVDh0224-_-qbt9d6mBeVE-7fsc,2259
@@ -193,7 +193,7 @@ reconcile/dynatrace_token_provider/validate.py,sha256=40_9QmHoB3-KBc0k_0D4QO00Pp
193
193
  reconcile/endpoints_discovery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
194
194
  reconcile/endpoints_discovery/integration.py,sha256=fzy5tv4c_6WoAZGGBNJ276NVNB1OESuSJMhZh4-ZNm8,14711
195
195
  reconcile/endpoints_discovery/merge_request.py,sha256=_yLb4tnvoZMCko8rta2C_CvOInJa9pa3HzSmHNtjgGU,2978
196
- reconcile/endpoints_discovery/merge_request_manager.py,sha256=wUMsumxv8RnWaRattax4HfoRlhtVzmgro3GiJJ1C4Vc,6392
196
+ reconcile/endpoints_discovery/merge_request_manager.py,sha256=a8zTIQIpRrUwXexZClwpQnnkEoS6XNZLJziI9x7ly0s,6389
197
197
  reconcile/external_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
198
198
  reconcile/external_resources/aws.py,sha256=wzN3GHxyqVa4Lqqg5HdogqNW2RM532t0ZiKaQeVGOL4,10968
199
199
  reconcile/external_resources/factories.py,sha256=C0QHT0soEv6z99-ELAAE19S5MaMHhV0t1fSiQn0Coc4,5970
@@ -464,7 +464,7 @@ reconcile/saas_auto_promotions_manager/merge_request_manager/__init__.py,sha256=
464
464
  reconcile/saas_auto_promotions_manager/merge_request_manager/batcher.py,sha256=R2CRtjdOggY5lSqt-A5qz2ymqomx4opVeVV_oqBAW0A,7804
465
465
  reconcile/saas_auto_promotions_manager/merge_request_manager/desired_state.py,sha256=isY8frVsL3PlcdZmdZ4O0qyp76oczl4DUMX9uMArs5Y,1222
466
466
  reconcile/saas_auto_promotions_manager/merge_request_manager/merge_request.py,sha256=BeAJWLow7b4HQyZ9zz398sQkPeIz8chpMkCts2NU27c,1282
467
- reconcile/saas_auto_promotions_manager/merge_request_manager/merge_request_manager_v2.py,sha256=PBvMnnrIT_DGkoVyOU8xwnzZUiuwrHOc1OFSXuAfjDo,6381
467
+ reconcile/saas_auto_promotions_manager/merge_request_manager/merge_request_manager_v2.py,sha256=wNOsdo7L8IWZa50oE0fA7ib_mFXKCZHe4DmJ1mW5KWY,6378
468
468
  reconcile/saas_auto_promotions_manager/merge_request_manager/metrics.py,sha256=sdHp71Wl87tFM-Z_QvqvdHhyrppFLGi4ekksCi_e_bs,977
469
469
  reconcile/saas_auto_promotions_manager/merge_request_manager/mr_parser.py,sha256=gG4HuQGgZnPC9xtvQzjVYAuWWBWWVYSZpOo50_ebuhg,8620
470
470
  reconcile/saas_auto_promotions_manager/merge_request_manager/open_merge_requests.py,sha256=-qGQOh6Jdp4lomNDij3zWVC0pl6uPHFWS5Woqcp5HQk,410
@@ -501,11 +501,11 @@ reconcile/templating/lib/rendering.py,sha256=IzTbXJ5cO0c9mV6P9HrstOo79ovOcoNVtmy
501
501
  reconcile/terraform_init/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
502
502
  reconcile/terraform_init/integration.py,sha256=glQ9uy8Kj2aTQXCAupwSFeih7reX_xMX_UuWW_ywBMU,6100
503
503
  reconcile/terraform_init/merge_request.py,sha256=3CYtgSd7Q9zjKg4wsDz437EPCRfGeZZ8fZ0Y-ChKXJY,1475
504
- reconcile/terraform_init/merge_request_manager.py,sha256=fMcT6hbdEF3nFATJpvr8BedvQHq_MzFkgVJSloBNwOQ,3101
504
+ reconcile/terraform_init/merge_request_manager.py,sha256=TQmtHq4DH-xgyYvuRyGu7VEgjPU2Yjj-uexIy-L7i88,3098
505
505
  reconcile/terraform_vpc_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
506
506
  reconcile/terraform_vpc_resources/integration.py,sha256=8pmcr0YTrW2QynenMCfaaXT4SV8SbH_eXx1OCyh0anA,8181
507
507
  reconcile/terraform_vpc_resources/merge_request.py,sha256=loRymUigCIvaaT0s_NzktZchh-DGRQnCICdBSCAcFPY,1503
508
- reconcile/terraform_vpc_resources/merge_request_manager.py,sha256=Vj2nuQbQyrL4q_il1My-bLxYNh_r3YXqX45P8fwtP6Q,3259
508
+ reconcile/terraform_vpc_resources/merge_request_manager.py,sha256=6jfwgbqXEFQlgLM6zmModpOkQX8wqddpoE0pZJL1Acc,3256
509
509
  reconcile/typed_queries/__init__.py,sha256=rRk4CyslLsBr4vAh1pIPgt6s3P4R1M9NSEPLnyQgBpk,61
510
510
  reconcile/typed_queries/alerting_services_settings.py,sha256=YKQd60O_2C_H103nLrYgcUInndM2vFypqW_NO706L2E,833
511
511
  reconcile/typed_queries/app_interface_custom_messages.py,sha256=bgSAJEzqee8aiPVCj_bIIqb4VTkrF0-vti1dos7ebEg,684
@@ -637,12 +637,12 @@ reconcile/utils/state.py,sha256=az4tBmZ0EdbFcAGiBVUxs3cr2-BVWsuDQiNTvjjQq8s,1637
637
637
  reconcile/utils/structs.py,sha256=LcbLEg8WxfRqM6nW7NhcWN0YeqF7SQzxOgntmLs1SgY,352
638
638
  reconcile/utils/template.py,sha256=wTvRU4AnAV_o042tD4Mwls2dwWMuk7MKnde3MaCjaYg,331
639
639
  reconcile/utils/terraform_client.py,sha256=H8frsS370y8xfivKLNBD1dwlBLHvfuR6JSN_syBL5Qc,36033
640
- reconcile/utils/terrascript_aws_client.py,sha256=hPfWduAsMpVUcYgw1cx7tiAyVmsJ1BdTCqPzyYPTThE,286260
640
+ reconcile/utils/terrascript_aws_client.py,sha256=n22HESuN24UVT9g0cEqLWqy1n6_RnCTGSQqt-Sg39Qw,286203
641
641
  reconcile/utils/three_way_diff_strategy.py,sha256=oQcHXd9LVhirJfoaOBoHUYuZVGfyL2voKr6KVI34zZE,4833
642
642
  reconcile/utils/throughput.py,sha256=iP4UWAe2LVhDo69mPPmgo9nQ7RxHD6_GS8MZe-aSiuM,344
643
643
  reconcile/utils/vault.py,sha256=aSA8l9cJlPUHpChFGl27nSY-Mpq9FMjBo7Dcgb1BVfM,15036
644
644
  reconcile/utils/vaultsecretref.py,sha256=0KUSzuvTRxPyKY919TO3-B_eYg4_76fzKvMF8j5s1G0,911
645
- reconcile/utils/vcs.py,sha256=fcNwWlhrknxg3QUs8BZ23wxTe3ISS7GFZxwFUZZG-wg,8718
645
+ reconcile/utils/vcs.py,sha256=YtjR3E_VaS7lA4ROzSr7hte-8G-SZ_UmJP5RJ2DCyJk,8807
646
646
  reconcile/utils/acs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
647
647
  reconcile/utils/acs/base.py,sha256=4UsDrCpAOuddL3PKNuIQYoJP1BtZQNNB8_KEX0lXneg,2532
648
648
  reconcile/utils/acs/notifiers.py,sha256=nHVw9C_2-K4nv5zq26jlOTSw1roY6TKlovi1sOfpxpI,4998
@@ -777,7 +777,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
777
777
  tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
778
778
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
779
779
  tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
780
- qontract_reconcile-0.10.2.dev67.dist-info/METADATA,sha256=Nyd438BM7Sf5HGgYKflFl_4LLGDU4l0YQ-4r5AYn5DM,24665
781
- qontract_reconcile-0.10.2.dev67.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
782
- qontract_reconcile-0.10.2.dev67.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
783
- qontract_reconcile-0.10.2.dev67.dist-info/RECORD,,
780
+ qontract_reconcile-0.10.2.dev69.dist-info/METADATA,sha256=__Xodwd_e1SiI9n8rqIwezBhNtoH4c6JYPZvxk3vxl4,24665
781
+ qontract_reconcile-0.10.2.dev69.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
782
+ qontract_reconcile-0.10.2.dev69.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
783
+ qontract_reconcile-0.10.2.dev69.dist-info/RECORD,,
@@ -85,7 +85,7 @@ class MergeRequestManager:
85
85
  return None
86
86
 
87
87
  try:
88
- self._vcs.get_file_content_from_app_interface_master(
88
+ self._vcs.get_file_content_from_app_interface_ref(
89
89
  file_path=account_tmpl_file_path
90
90
  )
91
91
  # File already exists. nothing to do.
@@ -116,7 +116,7 @@ class MergeRequestManager(MergeRequestManagerBase[AVSInfo]):
116
116
  return None
117
117
 
118
118
  try:
119
- content = self._vcs.get_file_content_from_app_interface_master(
119
+ content = self._vcs.get_file_content_from_app_interface_ref(
120
120
  file_path=namespace_file
121
121
  )
122
122
  except GitlabGetError as e:
@@ -149,7 +149,7 @@ class MergeRequestManager(MergeRequestManagerBase[EPDInfo]):
149
149
  )
150
150
  for app in apps:
151
151
  try:
152
- content = self._vcs.get_file_content_from_app_interface_master(
152
+ content = self._vcs.get_file_content_from_app_interface_ref(
153
153
  file_path=app.path
154
154
  )
155
155
  except GitlabGetError as e:
@@ -83,7 +83,7 @@ class MergeRequestManagerV2:
83
83
  if sub.target_file_path not in content_by_path:
84
84
  try:
85
85
  content_by_path[sub.target_file_path] = (
86
- self._vcs.get_file_content_from_app_interface_master(
86
+ self._vcs.get_file_content_from_app_interface_ref(
87
87
  file_path=sub.target_file_path
88
88
  )
89
89
  )
@@ -78,7 +78,7 @@ class MergeRequestManager(MergeRequestManagerBase[Info]):
78
78
  return None
79
79
 
80
80
  try:
81
- self._vcs.get_file_content_from_app_interface_master(file_path=data.path)
81
+ self._vcs.get_file_content_from_app_interface_ref(file_path=data.path)
82
82
  # the file exists, nothing to do
83
83
  return None
84
84
  except GitlabGetError as e:
@@ -83,7 +83,7 @@ class MergeRequestManager(MergeRequestManagerBase[Info]):
83
83
  return None
84
84
 
85
85
  try:
86
- self._vcs.get_file_content_from_app_interface_master(file_path=data.path)
86
+ self._vcs.get_file_content_from_app_interface_ref(file_path=data.path)
87
87
  # the file exists, nothing to do
88
88
  return None
89
89
  except GitlabGetError as e:
@@ -5179,13 +5179,13 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
5179
5179
  return {condition_type_key: {"values": condition[condition_type_key]}}
5180
5180
 
5181
5181
  @staticmethod
5182
- def _get_principal_for_s3_bucket_policy(
5183
- region: str, elb_account_id: str | None
5184
- ) -> Mapping[str, str]:
5182
+ def _get_principal_for_s3_bucket_policy(region: str) -> Mapping[str, str]:
5185
5183
  if region in AWS_ELB_ACCOUNT_IDS:
5186
- return {"AWS": f"arn:aws:iam::{elb_account_id}:root"}
5184
+ return {"AWS": f"arn:aws:iam::{AWS_ELB_ACCOUNT_IDS[region]}:root"}
5187
5185
  if region in AWS_US_GOV_ELB_ACCOUNT_IDS:
5188
- return {"AWS": f"arn:aws-us-gov:iam::{elb_account_id}:root"}
5186
+ return {
5187
+ "AWS": f"arn:aws-us-gov:iam::{AWS_US_GOV_ELB_ACCOUNT_IDS[region]}:root"
5188
+ }
5189
5189
  return {"Service": "logdelivery.elasticloadbalancing.amazonaws.com"}
5190
5190
 
5191
5191
  def populate_tf_resource_alb(self, spec, ocm_map=None):
@@ -5305,8 +5305,7 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
5305
5305
  region = str(
5306
5306
  common_values.get("region") or self.default_regions.get(account)
5307
5307
  )
5308
- elb_account_id = self._get_elb_account_id(region)
5309
- principal = self._get_principal_for_s3_bucket_policy(region, elb_account_id)
5308
+ principal = self._get_principal_for_s3_bucket_policy(region)
5310
5309
 
5311
5310
  policy = {
5312
5311
  "Version": "2012-10-17",
reconcile/utils/vcs.py CHANGED
@@ -216,14 +216,17 @@ class VCS:
216
216
  self._app_interface_api.close(mr)
217
217
  self._app_interface_api.delete_branch(source_branch)
218
218
 
219
- def get_file_content_from_app_interface_master(self, file_path: str) -> str:
220
- file_path = (
221
- f"data/{file_path.lstrip('/')}"
222
- if not file_path.startswith("data")
223
- else file_path
224
- )
219
+ def get_file_content_from_app_interface_ref(
220
+ self, file_path: str, ref: str = "master", is_data: bool = True
221
+ ) -> str:
222
+ if is_data:
223
+ file_path = (
224
+ f"data/{file_path.lstrip('/')}"
225
+ if not file_path.startswith("data")
226
+ else file_path
227
+ )
225
228
  return (
226
- self._app_interface_api.project.files.get(file_path=file_path, ref="master")
229
+ self._app_interface_api.project.files.get(file_path=file_path, ref=ref)
227
230
  .decode()
228
231
  .decode("utf-8")
229
232
  )