qontract-reconcile 0.10.1rc892__py3-none-any.whl → 0.10.1rc893__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.1rc892
3
+ Version: 0.10.1rc893
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
@@ -705,7 +705,7 @@ reconcile/utils/state.py,sha256=sJbfxvSTnHlHfgQRc_vRz-U_9NnVFGq-W8DX3ZHkfeY,1635
705
705
  reconcile/utils/structs.py,sha256=LcbLEg8WxfRqM6nW7NhcWN0YeqF7SQzxOgntmLs1SgY,352
706
706
  reconcile/utils/template.py,sha256=wTvRU4AnAV_o042tD4Mwls2dwWMuk7MKnde3MaCjaYg,331
707
707
  reconcile/utils/terraform_client.py,sha256=zbx5Ng2Xm7P93qqvFCbR-2FFYUTlmZbLGYNWvpkDtzE,32400
708
- reconcile/utils/terrascript_aws_client.py,sha256=ZX6oJWYmxRxbOkGYhCLAhFr20dIQy_TWZCqQL_1KDPg,275885
708
+ reconcile/utils/terrascript_aws_client.py,sha256=kU--Qk42v7OXbOtBEBhgRPRdSiFcfXOvMS6stHs0r_o,276712
709
709
  reconcile/utils/three_way_diff_strategy.py,sha256=OniTnogBkdgy_7Xg51N1MgjS-Qtk8uM1ccjWaiXxiV8,4895
710
710
  reconcile/utils/throughput.py,sha256=iP4UWAe2LVhDo69mPPmgo9nQ7RxHD6_GS8MZe-aSiuM,344
711
711
  reconcile/utils/vault.py,sha256=f4mJLKE5vGMvNBbo8Xe0dPFLF5-Vchs5Ry5lyf0FuMg,14902
@@ -843,8 +843,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
843
843
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
844
844
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
845
845
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
846
- qontract_reconcile-0.10.1rc892.dist-info/METADATA,sha256=e9L24wufs03igQkaJ7Ej0xluece2ZuN9tfjotAvkYzs,2273
847
- qontract_reconcile-0.10.1rc892.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
848
- qontract_reconcile-0.10.1rc892.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
849
- qontract_reconcile-0.10.1rc892.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
850
- qontract_reconcile-0.10.1rc892.dist-info/RECORD,,
846
+ qontract_reconcile-0.10.1rc893.dist-info/METADATA,sha256=A3ull9J-AQJJZxjP8YfvEdefC57el1s7Wp58B9RjnkM,2273
847
+ qontract_reconcile-0.10.1rc893.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
848
+ qontract_reconcile-0.10.1rc893.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
849
+ qontract_reconcile-0.10.1rc893.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
850
+ qontract_reconcile-0.10.1rc893.dist-info/RECORD,,
@@ -7,6 +7,7 @@ import random
7
7
  import re
8
8
  import string
9
9
  import tempfile
10
+ from collections import Counter
10
11
  from collections.abc import (
11
12
  Iterable,
12
13
  Mapping,
@@ -272,6 +273,18 @@ DEFAULT_TAGS = {
272
273
  }
273
274
 
274
275
 
276
+ class OutputResourceNameNotUniqueException(Exception):
277
+ def __init__(self, namespace, duplicates):
278
+ self.namespace, self.duplicates = namespace, duplicates
279
+ super().__init__(
280
+ str.format(
281
+ "Found duplicate values {} for 'output_resource_name' in namespace {}. Please ensure 'output_resource_name' is unique in a given namespace.",
282
+ self.duplicates,
283
+ self.namespace,
284
+ )
285
+ )
286
+
287
+
275
288
  class StateInaccessibleException(Exception):
276
289
  pass
277
290
 
@@ -1491,12 +1504,19 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
1491
1504
  specs = get_external_resource_specs(
1492
1505
  namespace_info, provision_provider=PROVIDER_AWS
1493
1506
  )
1507
+ name_counter = Counter(spec.output_resource_name for spec in specs)
1508
+ duplicates = [name for name, count in name_counter.items() if count > 1]
1509
+ if duplicates:
1510
+ raise OutputResourceNameNotUniqueException(
1511
+ namespace_info.get("name"), duplicates
1512
+ )
1494
1513
  for spec in specs:
1495
1514
  if account_names and spec.provisioner_name not in account_names:
1496
1515
  continue
1497
1516
  self.account_resource_specs.setdefault(
1498
1517
  spec.provisioner_name, []
1499
1518
  ).append(spec)
1519
+
1500
1520
  self.resource_spec_inventory[spec.id_object()] = spec
1501
1521
 
1502
1522
  def populate_tf_resources(self, spec, ocm_map=None):