qontract-reconcile 0.10.1rc1167__py3-none-any.whl → 0.10.1rc1169__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.
- {qontract_reconcile-0.10.1rc1167.dist-info → qontract_reconcile-0.10.1rc1169.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc1167.dist-info → qontract_reconcile-0.10.1rc1169.dist-info}/RECORD +11 -11
- reconcile/ldap_users.py +3 -0
- reconcile/queries.py +17 -15
- reconcile/terraform_resources.py +2 -4
- reconcile/test/test_ldap_users.py +4 -0
- reconcile/utils/mr/user_maintenance.py +21 -0
- reconcile/utils/terrascript_aws_client.py +40 -24
- {qontract_reconcile-0.10.1rc1167.dist-info → qontract_reconcile-0.10.1rc1169.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc1167.dist-info → qontract_reconcile-0.10.1rc1169.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc1167.dist-info → qontract_reconcile-0.10.1rc1169.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc1167.dist-info → qontract_reconcile-0.10.1rc1169.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.1rc1169
|
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
|
{qontract_reconcile-0.10.1rc1167.dist-info → qontract_reconcile-0.10.1rc1169.dist-info}/RECORD
RENAMED
@@ -48,7 +48,7 @@ reconcile/jenkins_webhooks_cleaner.py,sha256=JsN_NVPfZJwv1JtSzZXDIHUqGiefL-DRffF
|
|
48
48
|
reconcile/jenkins_worker_fleets.py,sha256=PMNGOX0krubFjInPiFT0za0KCiWBLEcVDuXdKRd1BrE,5378
|
49
49
|
reconcile/jira_permissions_validator.py,sha256=t8FBjBJniRMODQNXfoHKst6qLDOzlua6hqy7rm7tmzs,13222
|
50
50
|
reconcile/jira_watcher.py,sha256=L_UL2MKm2SoIGNsCLThm28pnqCkoFc154JWsD6bURug,3593
|
51
|
-
reconcile/ldap_users.py,sha256=
|
51
|
+
reconcile/ldap_users.py,sha256=7hdO5CAPl-VNBvDRmKHg13LoblHXXPt7YEKNGomAoGg,3158
|
52
52
|
reconcile/mr_client_gateway.py,sha256=WhjMd-sIXDFCV8-rt8CEjurJ5OYB1pOD0K3o0tZRXQg,1885
|
53
53
|
reconcile/ocm_additional_routers.py,sha256=KfcFDVbNoc6n5dHWjYdAf1_DiVqVG6Tw23WLKoV8cdg,3306
|
54
54
|
reconcile/ocm_addons.py,sha256=qqAyqRBRbdZQvAcjb-QlSVyRAyQBZk6iVlgnI4jyi7s,3353
|
@@ -94,7 +94,7 @@ reconcile/quay_mirror.py,sha256=mFp4Z5Nwl-DcFbbsJBOB8f9ldohFT-V67o868d5ux1s,1536
|
|
94
94
|
reconcile/quay_mirror_org.py,sha256=utrJpJaKCs7U6WX6DODdfCeB0EmX-lUC8Y5fkmpgFSs,10764
|
95
95
|
reconcile/quay_permissions.py,sha256=9KOutS1w4RFQqkvMSy54VtsKNx56-phzP6yI_rEW-B8,4244
|
96
96
|
reconcile/quay_repos.py,sha256=cuEYG0HUe0ut5yvLdEwOF5-CmccpXQHRb_wDazvDrvQ,6895
|
97
|
-
reconcile/queries.py,sha256=
|
97
|
+
reconcile/queries.py,sha256=of54G-Vqy-_deKdZcWs-B9LwxIdhQFUlQ198pBGCp3g,51488
|
98
98
|
reconcile/query_validator.py,sha256=MSh5pKLBksws4AqfuvT8nrIGucIbqX-IOzYyPYTLO7k,1491
|
99
99
|
reconcile/requests_sender.py,sha256=914iluuF4UVgG3VyxxtnHOu4yf6YKS2fIy6PViSsFTQ,3875
|
100
100
|
reconcile/resource_scraper.py,sha256=znXCHrU7YwPfKuxGBiUrV7T1tYtn4vlz9qmZlfy6Flg,2307
|
@@ -113,7 +113,7 @@ reconcile/terraform_cloudflare_dns.py,sha256=-aLEe2QnH5cJPu7HWqs-R9NmQ1NlFbcVUm0
|
|
113
113
|
reconcile/terraform_cloudflare_resources.py,sha256=pq8Ieo5NmB-dYQ9X2F0s6iEoINMzhiqGw2yQK4ovok4,14980
|
114
114
|
reconcile/terraform_cloudflare_users.py,sha256=iyTG5sj20Jg4J4qWJ144KVptfIHGOSfH8wQKxu0imq0,13942
|
115
115
|
reconcile/terraform_repo.py,sha256=TKqlodhQGoAtQ6nDm04TNlpx4wpgJ_n4atoUK5Rfd7o,16444
|
116
|
-
reconcile/terraform_resources.py,sha256=
|
116
|
+
reconcile/terraform_resources.py,sha256=iufjMJs_aSEvmh7Cg11beCxKmV8nrOLOpEtiTryPNx0,19470
|
117
117
|
reconcile/terraform_tgw_attachments.py,sha256=09svJG9pAiwWp4aY0xRoQRV90T4ZNwHG3r8flI-ZS_s,18810
|
118
118
|
reconcile/terraform_users.py,sha256=HqSm3ev3b8dZ9J6F_phDZB-FQsnlsdeKp9RPoY1cU94,10188
|
119
119
|
reconcile/terraform_vpc_peerings.py,sha256=VLSfuO7FvHN5McopRiKoKJDHCmIhYtlJEHv_hxV5kcM,27669
|
@@ -527,7 +527,7 @@ reconcile/test/test_integrations_manager.py,sha256=xpyQAVz57wAbovrcQzAeuyq8VzdIt
|
|
527
527
|
reconcile/test/test_jenkins_worker_fleets.py,sha256=o1jlT7OBBSgu0M3iI4xMdz_x6SciF7yhNBpLk5gTJfg,2361
|
528
528
|
reconcile/test/test_jira_permissions_validator.py,sha256=zhtAL97IkCyY9R29fDRvDCE1z9S7OVQV7gqu-7Vo5-4,16279
|
529
529
|
reconcile/test/test_jump_host.py,sha256=EeHMhT5rTZgx__R_29mtCBWt-NZCcKsQ6CR-B3xmCps,3284
|
530
|
-
reconcile/test/test_ldap_users.py,sha256=
|
530
|
+
reconcile/test/test_ldap_users.py,sha256=_clylG-Qfes8yNb9T3CMaDQovLwyVZlTfJgRtGHARgE,4080
|
531
531
|
reconcile/test/test_make.py,sha256=zTdjgq-3idFlec_0qJenk9wWw0QMLvSpJfPsptXmync,677
|
532
532
|
reconcile/test/test_ocm_additional_routers.py,sha256=vX_O5js8PDTXU2mLD89tcMBqdpDKRNFWwxBB_UKP3Cc,4206
|
533
533
|
reconcile/test/test_ocm_clusters.py,sha256=QDieDrP7pjH7jw5pFcZkUGx1lUhd2Cdg8BM0bRnhhI8,24322
|
@@ -727,7 +727,7 @@ reconcile/utils/state.py,sha256=W0_awkLAPX18hNOF_60o73tkPxDUylqbzYNHfl_sDsk,1638
|
|
727
727
|
reconcile/utils/structs.py,sha256=LcbLEg8WxfRqM6nW7NhcWN0YeqF7SQzxOgntmLs1SgY,352
|
728
728
|
reconcile/utils/template.py,sha256=wTvRU4AnAV_o042tD4Mwls2dwWMuk7MKnde3MaCjaYg,331
|
729
729
|
reconcile/utils/terraform_client.py,sha256=LjX2U2E0Dglt2S_KA5jWQ_dVC8sPn4FEAh0xW_d6JTk,35953
|
730
|
-
reconcile/utils/terrascript_aws_client.py,sha256=
|
730
|
+
reconcile/utils/terrascript_aws_client.py,sha256=q6Ydbjle7K5Z3LYpoRJGXnb50ix6aGN6jLvP2vglPz8,283769
|
731
731
|
reconcile/utils/three_way_diff_strategy.py,sha256=oQcHXd9LVhirJfoaOBoHUYuZVGfyL2voKr6KVI34zZE,4833
|
732
732
|
reconcile/utils/throughput.py,sha256=iP4UWAe2LVhDo69mPPmgo9nQ7RxHD6_GS8MZe-aSiuM,344
|
733
733
|
reconcile/utils/vault.py,sha256=pi0PuyopvCq1gW0cldvy1-Ff6bqLUlCKC2MW0sifvSE,15043
|
@@ -786,7 +786,7 @@ reconcile/utils/mr/notificator.py,sha256=cp80wFzu_ZzrJPye7L1pI0H6JRGb7hOGuNxJYUq
|
|
786
786
|
reconcile/utils/mr/ocm_update_recommended_version.py,sha256=p_aVP0TGrlKk9WBwgQnYWqUDsED_Hg6G5Bqj0UvtRwA,1536
|
787
787
|
reconcile/utils/mr/ocm_upgrade_scheduler_org_updates.py,sha256=ojnIjw-8vRnmCCxOGBOEgPZLH4nC1hcuef74LWw2Rpk,3004
|
788
788
|
reconcile/utils/mr/promote_qontract.py,sha256=wgvX2CBlcZaihKJSXJ0zcEK8NGaEP2_DUQDz0STzGes,7158
|
789
|
-
reconcile/utils/mr/user_maintenance.py,sha256=
|
789
|
+
reconcile/utils/mr/user_maintenance.py,sha256=ZlR1Id_r2BUXsoerJW-0Ioh5bcbwlnQxBBhSs-ri9Dk,5099
|
790
790
|
reconcile/utils/ocm/__init__.py,sha256=Y-bp8GomMpyCo0tFW6kJ78-ZG1UIupYRtBzbMWU0kwM,798
|
791
791
|
reconcile/utils/ocm/addons.py,sha256=_LDdJ-gapM3s5exKlIUt-MlXZTAUoHezbYBU0QmvfWQ,7335
|
792
792
|
reconcile/utils/ocm/base.py,sha256=iL_uMN03URDisWHpsaGGto_pLx652epUkuld_9ctx5o,14555
|
@@ -880,8 +880,8 @@ tools/test/test_qontract_cli.py,sha256=iuzKbQ6ahinvjoQmQLBrG4shey0z-1rB6qCgS8T6d
|
|
880
880
|
tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
|
881
881
|
tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
|
882
882
|
tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
|
883
|
-
qontract_reconcile-0.10.
|
884
|
-
qontract_reconcile-0.10.
|
885
|
-
qontract_reconcile-0.10.
|
886
|
-
qontract_reconcile-0.10.
|
887
|
-
qontract_reconcile-0.10.
|
883
|
+
qontract_reconcile-0.10.1rc1169.dist-info/METADATA,sha256=YlzW8en2-M_JB_DAj-tB1zQc-cJ4E3uA7a3D34mIifg,2213
|
884
|
+
qontract_reconcile-0.10.1rc1169.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
885
|
+
qontract_reconcile-0.10.1rc1169.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
|
886
|
+
qontract_reconcile-0.10.1rc1169.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
887
|
+
qontract_reconcile-0.10.1rc1169.dist-info/RECORD,,
|
reconcile/ldap_users.py
CHANGED
@@ -37,6 +37,9 @@ def init_users() -> list[dict[str, list]]:
|
|
37
37
|
for a in user.get("aws_accounts", []):
|
38
38
|
item = {"type": PathTypes.AWS_ACCOUNTS, "path": "data" + a["path"]}
|
39
39
|
users[u].append(item)
|
40
|
+
for s in user.get("schedules"):
|
41
|
+
item = {"type": PathTypes.SCHEDULE, "path": "data" + s["path"]}
|
42
|
+
users[u].append(item)
|
40
43
|
|
41
44
|
return [{"username": username, "paths": paths} for username, paths in users.items()]
|
42
45
|
|
reconcile/queries.py
CHANGED
@@ -102,11 +102,12 @@ APP_INTERFACE_SETTINGS_QUERY = """
|
|
102
102
|
readTimeout
|
103
103
|
connectTimeout
|
104
104
|
}
|
105
|
-
|
106
|
-
|
107
|
-
|
105
|
+
terraformResourcesProviderExclusions {
|
106
|
+
provider
|
107
|
+
excludeProvisioners {
|
108
|
+
name
|
108
109
|
}
|
109
|
-
|
110
|
+
excludeAllProvisioners
|
110
111
|
}
|
111
112
|
}
|
112
113
|
}
|
@@ -1832,6 +1833,9 @@ USERS_QUERY = """
|
|
1832
1833
|
gabi_instances {
|
1833
1834
|
path
|
1834
1835
|
}
|
1836
|
+
schedules {
|
1837
|
+
path
|
1838
|
+
}
|
1835
1839
|
{% endif %}
|
1836
1840
|
}
|
1837
1841
|
}
|
@@ -2764,12 +2768,13 @@ def get_jenkins_configs():
|
|
2764
2768
|
|
2765
2769
|
TF_RESOURCES_PROVIDER_EXCLUSIONS_BY_PROVISIONER = """
|
2766
2770
|
{
|
2767
|
-
|
2768
|
-
|
2769
|
-
|
2770
|
-
|
2771
|
+
tf_provider_exclusions: app_interface_settings_v1 {
|
2772
|
+
terraformResourcesProviderExclusions {
|
2773
|
+
provider
|
2774
|
+
excludeProvisioners {
|
2775
|
+
name
|
2771
2776
|
}
|
2772
|
-
|
2777
|
+
excludeAllProvisioners
|
2773
2778
|
}
|
2774
2779
|
}
|
2775
2780
|
}
|
@@ -2781,13 +2786,10 @@ def get_tf_resources_provider_exclusions_by_provisioner() -> (
|
|
2781
2786
|
):
|
2782
2787
|
gqlapi = gql.get_api()
|
2783
2788
|
settings = gqlapi.query(TF_RESOURCES_PROVIDER_EXCLUSIONS_BY_PROVISIONER)[
|
2784
|
-
"
|
2789
|
+
"tf_provider_exclusions"
|
2785
2790
|
]
|
2786
|
-
if (
|
2787
|
-
|
2788
|
-
and "terraformResourcesProviderExclusionsByProvisioner" in settings[0]
|
2789
|
-
):
|
2790
|
-
return settings[0]["terraformResourcesProviderExclusionsByProvisioner"]
|
2791
|
+
if len(settings) == 1 and "terraformResourcesProviderExclusions" in settings[0]:
|
2792
|
+
return settings[0]["terraformResourcesProviderExclusions"]
|
2791
2793
|
return None
|
2792
2794
|
|
2793
2795
|
|
reconcile/terraform_resources.py
CHANGED
@@ -266,13 +266,11 @@ def setup(
|
|
266
266
|
ocm_map = None
|
267
267
|
tf_namespaces_dicts = [ns.dict(by_alias=True) for ns in tf_namespaces]
|
268
268
|
|
269
|
-
|
270
|
-
settings.get("terraformResourcesProviderExclusionsByProvisioner") or []
|
271
|
-
)
|
269
|
+
provider_exclusions = settings.get("terraformResourcesProviderExclusions") or []
|
272
270
|
ts.init_populate_specs(
|
273
271
|
tf_namespaces_dicts,
|
274
272
|
account_names,
|
275
|
-
|
273
|
+
provider_exclusions,
|
276
274
|
)
|
277
275
|
tf.populate_terraform_output_secrets(
|
278
276
|
resource_specs=ts.resource_spec_inventory, init_rds_replica_source=True
|
@@ -14,6 +14,7 @@ def patched_queries_get_users(mocker):
|
|
14
14
|
"requests": [{"path": "test_path1"}],
|
15
15
|
"queries": [{"path": "another_test_path1"}],
|
16
16
|
"gabi_instances": [{"path": "yet_another_test_path1"}],
|
17
|
+
"schedules": [{"path": "and_yet_another_test_path1"}],
|
17
18
|
"path": "blah",
|
18
19
|
},
|
19
20
|
{
|
@@ -21,6 +22,7 @@ def patched_queries_get_users(mocker):
|
|
21
22
|
"requests": [{"path": "test_path2"}],
|
22
23
|
"queries": [{"path": "another_test_path2"}],
|
23
24
|
"gabi_instances": [{"path": "yet_another_test_path2"}],
|
25
|
+
"schedules": [{"path": "and_yet_another_test_path2"}],
|
24
26
|
"path": "blah",
|
25
27
|
},
|
26
28
|
{
|
@@ -28,6 +30,7 @@ def patched_queries_get_users(mocker):
|
|
28
30
|
"requests": [{"path": "test_path3"}],
|
29
31
|
"queries": [{"path": "another_test_path3"}],
|
30
32
|
"gabi_instances": [{"path": "yet_another_test_path3"}],
|
33
|
+
"schedules": [{"path": "and_yet_another_test_path3"}],
|
31
34
|
"path": "blah",
|
32
35
|
},
|
33
36
|
]
|
@@ -100,6 +103,7 @@ def test_ldap_users_no_dry_run(
|
|
100
103
|
{"path": "datatest_path3", "type": 1},
|
101
104
|
{"path": "dataanother_test_path3", "type": 2},
|
102
105
|
{"path": "datayet_another_test_path3", "type": 3},
|
106
|
+
{"path": "dataand_yet_another_test_path3", "type": 5},
|
103
107
|
],
|
104
108
|
)
|
105
109
|
assert patched_create_delete_user.method_calls[0][0] == "().submit"
|
@@ -1,3 +1,5 @@
|
|
1
|
+
from pathlib import Path
|
2
|
+
|
1
3
|
from ruamel import yaml
|
2
4
|
|
3
5
|
from reconcile.utils.gitlab_api import GitLabApi
|
@@ -11,6 +13,7 @@ class PathTypes:
|
|
11
13
|
QUERY = 2
|
12
14
|
GABI = 3
|
13
15
|
AWS_ACCOUNTS = 4
|
16
|
+
SCHEDULE = 5
|
14
17
|
|
15
18
|
|
16
19
|
class CreateDeleteUserAppInterface(MergeRequestBase):
|
@@ -68,6 +71,24 @@ class CreateDeleteUserAppInterface(MergeRequestBase):
|
|
68
71
|
commit_message=self.title,
|
69
72
|
content=new_content,
|
70
73
|
)
|
74
|
+
elif path_type == PathTypes.SCHEDULE:
|
75
|
+
raw_file = gitlab_cli.project.files.get(file_path=path, ref=self.branch)
|
76
|
+
content = yaml.load(raw_file.decode(), Loader=yaml.RoundTripLoader)
|
77
|
+
delete_indexes: list[tuple[int, int]] = []
|
78
|
+
for schedule_index, schedule_record in enumerate(content["schedule"]):
|
79
|
+
for user_index, user in enumerate(schedule_record["users"]):
|
80
|
+
if self.username == Path(user["$ref"]).stem:
|
81
|
+
delete_indexes.append((schedule_index, user_index))
|
82
|
+
for schedule_index, user_index in reversed(delete_indexes):
|
83
|
+
del content["schedule"][schedule_index]["users"][user_index]
|
84
|
+
new_content = "---\n"
|
85
|
+
new_content += yaml.dump(content, Dumper=yaml.RoundTripDumper)
|
86
|
+
gitlab_cli.update_file(
|
87
|
+
branch_name=self.branch,
|
88
|
+
file_path=path,
|
89
|
+
commit_message=self.title,
|
90
|
+
content=new_content,
|
91
|
+
)
|
71
92
|
|
72
93
|
|
73
94
|
class CreateDeleteUserInfra(MergeRequestBase):
|
@@ -9,7 +9,7 @@ import string
|
|
9
9
|
import tempfile
|
10
10
|
from collections import Counter
|
11
11
|
from collections.abc import Iterable, Mapping, MutableMapping
|
12
|
-
from dataclasses import dataclass
|
12
|
+
from dataclasses import dataclass, field
|
13
13
|
from ipaddress import (
|
14
14
|
ip_address,
|
15
15
|
ip_network,
|
@@ -379,6 +379,12 @@ class ElasticSearchLogGroupInfo:
|
|
379
379
|
log_group_identifier: str
|
380
380
|
|
381
381
|
|
382
|
+
@dataclass
|
383
|
+
class Exclusion:
|
384
|
+
all: bool = False
|
385
|
+
provisioners: set[str] = field(default_factory=set)
|
386
|
+
|
387
|
+
|
382
388
|
class ProviderExcludedError(Exception):
|
383
389
|
def __init__(self, spec: ExternalResourceSpec) -> None:
|
384
390
|
super().__init__(
|
@@ -1543,38 +1549,49 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
|
|
1543
1549
|
for spec in specs:
|
1544
1550
|
self.populate_tf_resources(spec, ocm_map=ocm_map)
|
1545
1551
|
|
1546
|
-
def
|
1552
|
+
def _is_provisioner_excluded(
|
1547
1553
|
self,
|
1548
1554
|
spec: ExternalResourceSpec,
|
1549
|
-
|
1550
|
-
) ->
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1555
|
+
provider_exclusions: Mapping[str, Exclusion],
|
1556
|
+
) -> bool:
|
1557
|
+
e = provider_exclusions.get(spec.provider)
|
1558
|
+
if not e:
|
1559
|
+
return False
|
1560
|
+
return e.all or spec.provisioner_name in e.provisioners
|
1554
1561
|
|
1555
1562
|
def _filter_specs_managed_by_erv2(
|
1556
1563
|
self,
|
1557
1564
|
specs: Iterable[ExternalResourceSpec],
|
1558
|
-
|
1565
|
+
provider_exclusions: Mapping[str, Exclusion],
|
1559
1566
|
) -> list[ExternalResourceSpec]:
|
1560
|
-
filtered_specs
|
1561
|
-
|
1562
|
-
|
1563
|
-
continue
|
1567
|
+
filtered_specs = [
|
1568
|
+
spec for spec in specs if not spec.resource.get("managed_by_erv2")
|
1569
|
+
]
|
1564
1570
|
|
1565
|
-
|
1566
|
-
|
1567
|
-
):
|
1571
|
+
for spec in filtered_specs:
|
1572
|
+
if self._is_provisioner_excluded(spec, provider_exclusions):
|
1568
1573
|
raise ProviderExcludedError(spec)
|
1569
1574
|
|
1570
|
-
filtered_specs.append(spec)
|
1571
1575
|
return filtered_specs
|
1572
1576
|
|
1577
|
+
def _get_provider_exclusions_query_dict(
|
1578
|
+
self, provider_exclusions: Iterable[Mapping[str, Any]]
|
1579
|
+
) -> dict[str, Exclusion]:
|
1580
|
+
return {
|
1581
|
+
item["provider"]: Exclusion(
|
1582
|
+
all=item.get("excludeAllProvisioners") or False,
|
1583
|
+
provisioners={
|
1584
|
+
p["name"] for p in (item.get("excludeProvisioners") or [])
|
1585
|
+
},
|
1586
|
+
)
|
1587
|
+
for item in provider_exclusions
|
1588
|
+
}
|
1589
|
+
|
1573
1590
|
def init_populate_specs(
|
1574
1591
|
self,
|
1575
1592
|
namespaces: Iterable[Mapping[str, Any]],
|
1576
1593
|
account_names: Iterable[str] | None,
|
1577
|
-
|
1594
|
+
provider_exclusions: Iterable[Mapping[str, Any]] | None = None,
|
1578
1595
|
) -> None:
|
1579
1596
|
"""
|
1580
1597
|
Initiates resource specs from the definitions in app-interface
|
@@ -1586,15 +1603,14 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
|
|
1586
1603
|
self.resource_spec_inventory: ExternalResourceSpecInventory = {}
|
1587
1604
|
|
1588
1605
|
# Ensure provider exclusions are fetched
|
1589
|
-
if
|
1590
|
-
|
1606
|
+
if provider_exclusions is None:
|
1607
|
+
provider_exclusions = (
|
1591
1608
|
queries.get_tf_resources_provider_exclusions_by_provisioner() or []
|
1592
1609
|
)
|
1593
1610
|
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
}
|
1611
|
+
provider_exclusions_query_dict = self._get_provider_exclusions_query_dict(
|
1612
|
+
provider_exclusions
|
1613
|
+
)
|
1598
1614
|
|
1599
1615
|
for namespace_info in namespaces:
|
1600
1616
|
all_specs = get_external_resource_specs(
|
@@ -1602,7 +1618,7 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
|
|
1602
1618
|
provision_provider=PROVIDER_AWS,
|
1603
1619
|
)
|
1604
1620
|
specs = self._filter_specs_managed_by_erv2(
|
1605
|
-
all_specs,
|
1621
|
+
all_specs, provider_exclusions_query_dict
|
1606
1622
|
)
|
1607
1623
|
name_counter = Counter(spec.output_resource_name for spec in specs)
|
1608
1624
|
duplicates = [name for name, count in name_counter.items() if count > 1]
|
{qontract_reconcile-0.10.1rc1167.dist-info → qontract_reconcile-0.10.1rc1169.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|