qontract-reconcile 0.10.1rc517__py3-none-any.whl → 0.10.1rc518__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.1
2
2
  Name: qontract-reconcile
3
- Version: 0.10.1rc517
3
+ Version: 0.10.1rc518
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Home-page: https://github.com/app-sre/qontract-reconcile
6
6
  Author: Red Hat App-SRE Team
@@ -114,7 +114,7 @@ reconcile/terraform_repo.py,sha256=c0GZFuY3rCm6VHjHqYbsgOHrEkRWKF_1LrMThsn2XDw,1
114
114
  reconcile/terraform_resources.py,sha256=x5Do4xBBhjJdIVRi0Gy4h-ryCCZ6kU7bT_iB0_mGing,17105
115
115
  reconcile/terraform_tgw_attachments.py,sha256=_g7QSHM03YZzTU7O189S4HYtUn7WmwOBq67G4AieU24,15298
116
116
  reconcile/terraform_users.py,sha256=kXRUxCUchKCP2dbXXOzctynqMii4oyCP6bYZHQTrlTg,10202
117
- reconcile/terraform_vpc_peerings.py,sha256=UoxjkOw_w5esHP2IeIsphxYPuhdvbDAfY97ubfnEH0g,25029
117
+ reconcile/terraform_vpc_peerings.py,sha256=rnDH1u93OyzrBM8Hib0HwSnlxZtx4ScRQaZAcn3mx-k,25402
118
118
  reconcile/vault_replication.py,sha256=b23ZfsQwS470GMvPPv1E6TU8MLBg3HX31_9IvMzE1tk,17280
119
119
  reconcile/vpc_peerings_validator.py,sha256=Kv22HJVlTW9l9GB2eXwjPWqdDbr_VuvQBNPttox6s5o,7177
120
120
  reconcile/aus/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -444,7 +444,7 @@ reconcile/test/test_terraform_resources.py,sha256=1ny_QSFuRjV9jxZY8EeT4NVJ5dMv7c
444
444
  reconcile/test/test_terraform_tgw_attachments.py,sha256=cAq6exc-K-jtLla1CZUZQzVnBkyDnIlL7jybnddhLKc,36861
445
445
  reconcile/test/test_terraform_users.py,sha256=Xn4y6EcxnNQb6XcPoOhz_Ikxmh9Nrsu88OM1scN9hzY,5434
446
446
  reconcile/test/test_terraform_vpc_peerings.py,sha256=ubcsKh0TrUIwuI1-W3ETIgzsFvzAyeoFmEJFC-IK6JY,20538
447
- reconcile/test/test_terraform_vpc_peerings_build_desired_state.py,sha256=Pyw8Jbp8lX5Tsk1yWZ0-4NJmwxqdwK1NnVYk6peLIQc,47440
447
+ reconcile/test/test_terraform_vpc_peerings_build_desired_state.py,sha256=DAfpb12I0PlqnuVUHK2vh4LH4d1OylT3H2GE_3TGZZI,47852
448
448
  reconcile/test/test_three_way_diff_strategy.py,sha256=2fjEqE2w4pIzKq18PRcADTSe01aGwsZfMGloU8xfNaE,3346
449
449
  reconcile/test/test_unleash.py,sha256=c1s_FRAZrAzzd3FbZrzHYjJzHELhoxPHBZnEzqsfMQg,6416
450
450
  reconcile/test/test_vault_replication.py,sha256=wlc4jm9f8P641UvvxIFFFc5_unJysNkOVrKJscjhQr0,16867
@@ -668,8 +668,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
668
668
  tools/test/test_qontract_cli.py,sha256=d18KrdhtUGqoC7_kWZU128U0-VJEj-0rjFkLVufcI6I,2755
669
669
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
670
670
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
671
- qontract_reconcile-0.10.1rc517.dist-info/METADATA,sha256=pm8ptXrk2UwiZZY4b3yOIkczJdFRVa5afyr01T7loMw,2349
672
- qontract_reconcile-0.10.1rc517.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
673
- qontract_reconcile-0.10.1rc517.dist-info/entry_points.txt,sha256=rTjAv28I_CHLM8ID3OPqMI_suoQ9s7tFbim4aYjn9kk,376
674
- qontract_reconcile-0.10.1rc517.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
675
- qontract_reconcile-0.10.1rc517.dist-info/RECORD,,
671
+ qontract_reconcile-0.10.1rc518.dist-info/METADATA,sha256=ZHIKdYpB_uP2Zw1T7VGzb55Zemh_NrefQFPc8opTj4Q,2349
672
+ qontract_reconcile-0.10.1rc518.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
673
+ qontract_reconcile-0.10.1rc518.dist-info/entry_points.txt,sha256=rTjAv28I_CHLM8ID3OPqMI_suoQ9s7tFbim4aYjn9kk,376
674
+ qontract_reconcile-0.10.1rc518.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
675
+ qontract_reconcile-0.10.1rc518.dist-info/RECORD,,
@@ -210,9 +210,11 @@ def build_desired_state_single_cluster(
210
210
  )
211
211
  )
212
212
  if requester_vpc_id is None:
213
- raise BadTerraformPeeringState(
214
- f"[{cluster_name}] could not find VPC ID for cluster"
213
+ logging.warning(
214
+ f"[{cluster_name}] could not find VPC ID for cluster. "
215
+ f"Skipping {peer_connection_provider} connection {peer_connection['name']}"
215
216
  )
217
+ continue
216
218
 
217
219
  requester = {
218
220
  "cidr_block": cluster_info["network"]["vpc"],
@@ -234,9 +236,11 @@ def build_desired_state_single_cluster(
234
236
  hcp_vpc_endpoint_sg=_private_hosted_control_plane(peer_cluster),
235
237
  )
236
238
  if accepter_vpc_id is None:
237
- raise BadTerraformPeeringState(
238
- f"[{peer_cluster_name}] could not find VPC ID for cluster"
239
+ logging.warning(
240
+ f"[{peer_cluster_name}] could not find VPC ID for cluster. "
241
+ f"Skipping {peer_info['provider']} connection {peer_info['name']}"
239
242
  )
243
+ continue
240
244
 
241
245
  requester["peer_owner_id"] = acc_aws["uid"]
242
246
  if acc_aws.get("assume_role"):
@@ -340,10 +344,11 @@ def build_desired_state_vpc_mesh_single_cluster(
340
344
  )
341
345
 
342
346
  if requester_vpc_id is None:
343
- raise BadTerraformPeeringState(
344
- f"{cluster} could not find VPC ID for cluster and "
345
- f"peer account {account}"
347
+ logging.warning(
348
+ f"[{cluster}] could not find VPC ID for cluster and peer account {account}. "
349
+ f"Skipping {peer_connection_provider} connection {peer_connection['name']}"
346
350
  )
351
+ continue
347
352
 
348
353
  requester["vpc_id"] = requester_vpc_id
349
354
  requester["route_table_ids"] = requester_route_table_ids
@@ -478,9 +483,11 @@ def build_desired_state_vpc_single_cluster(
478
483
  )
479
484
 
480
485
  if requester_vpc_id is None:
481
- raise BadTerraformPeeringState(
482
- f"[{cluster}] could not find VPC ID for cluster"
486
+ logging.warning(
487
+ f"[{cluster}] could not find VPC ID for cluster. "
488
+ f"Skipping {peer_connection_provider} connection {peer_connection['name']}"
483
489
  )
490
+ continue
484
491
 
485
492
  requester["vpc_id"] = requester_vpc_id
486
493
  requester["route_table_ids"] = requester_route_table_ids
@@ -466,11 +466,10 @@ def test_c2c_no_vpc_in_aws(mocker):
466
466
 
467
467
  awsapi = MockAWSAPI()
468
468
 
469
- with pytest.raises(sut.BadTerraformPeeringState) as ex:
470
- sut.build_desired_state_single_cluster(
471
- requester_cluster, ocm, awsapi, account_filter=None
472
- )
473
- assert str(ex.value).endswith("could not find VPC ID for cluster")
469
+ desired_state = sut.build_desired_state_single_cluster(
470
+ requester_cluster, ocm, awsapi, account_filter=None
471
+ )
472
+ assert desired_state == []
474
473
 
475
474
 
476
475
  def test_c2c_no_peer_account(mocker):
@@ -936,10 +935,10 @@ class TestBuildDesiredStateVpcMeshSingleCluster(testslide.TestCase):
936
935
  None,
937
936
  )).and_assert_called_once()
938
937
 
939
- with self.assertRaises(sut.BadTerraformPeeringState):
940
- sut.build_desired_state_vpc_mesh_single_cluster(
941
- self.cluster, self.ocm, self.awsapi, None
942
- )
938
+ desired_state = sut.build_desired_state_vpc_mesh_single_cluster(
939
+ self.cluster, self.ocm, self.awsapi, None
940
+ )
941
+ assert desired_state == []
943
942
 
944
943
 
945
944
  class TestBuildDesiredStateVpc(testslide.TestCase):
@@ -1341,7 +1340,22 @@ class TestBuildDesiredStateVpcSingleCluster(testslide.TestCase):
1341
1340
  self.ocm, "get_aws_infrastructure_access_terraform_assume_role"
1342
1341
  ).to_return_value("a:role:that:you:will:like").and_assert_called_once()
1343
1342
 
1344
- with self.assertRaises(sut.BadTerraformPeeringState):
1343
+ desired_state = sut.build_desired_state_vpc_single_cluster(
1344
+ self.cluster, self.ocm, self.awsapi, None
1345
+ )
1346
+ assert desired_state == []
1347
+
1348
+ def test_aws_exception(self):
1349
+ exc_txt = "AWS Problem!"
1350
+ self.mock_callable(self.awsapi, "get_cluster_vpc_details").to_raise(
1351
+ Exception(exc_txt)
1352
+ )
1353
+
1354
+ self.mock_callable(
1355
+ self.ocm, "get_aws_infrastructure_access_terraform_assume_role"
1356
+ ).to_return_value("a:role:that:you:will:like").and_assert_called_once()
1357
+
1358
+ with pytest.raises(Exception, match=exc_txt):
1345
1359
  sut.build_desired_state_vpc_single_cluster(
1346
1360
  self.cluster, self.ocm, self.awsapi, None
1347
1361
  )