qontract-reconcile 0.10.1rc1166__py3-none-any.whl → 0.10.1rc1168__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.1rc1166
3
+ Version: 0.10.1rc1168
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
@@ -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=uEWQ0V41tN9KCZi4ZKPamjrJ6djSpdpvDBo7yJ0e7ZI,3008
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=04Xkm1wVg803ukZ_28Ud6AeiLJGVihl4f_UVoERv9uU,51509
97
+ reconcile/queries.py,sha256=RF3lGuwo_Y6J_NDdb7XN4s9vBWxHPzfTzw_8mCZcwLQ,51542
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
@@ -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=8jjzVgoiRRylGad6-TvkugoFGXt3eko--zVVKjmZDn4,3812
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=9-3mmZtiIrpu_uZrPPtSWgf-elbAG6jeureCUzkWQO4,283459
730
+ reconcile/utils/terrascript_aws_client.py,sha256=k2N_ojFPhiPwI0KdkPpfgboq7D9OgledxTSwKarHpKM,283460
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=cHPBn8zrReWLHalyk-EFdkFJe9zjVjRoZhT4t2zZfGE,3956
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.1rc1166.dist-info/METADATA,sha256=ru93sln6IVHsJ8rmuUw2C1jLSzNMey-obelfXbhXBvU,2213
884
- qontract_reconcile-0.10.1rc1166.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
885
- qontract_reconcile-0.10.1rc1166.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
886
- qontract_reconcile-0.10.1rc1166.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
887
- qontract_reconcile-0.10.1rc1166.dist-info/RECORD,,
883
+ qontract_reconcile-0.10.1rc1168.dist-info/METADATA,sha256=S5PpMUixHxBbTgNxlV_1wOQVEw9FKiyt5Tw4H9p0Uuc,2213
884
+ qontract_reconcile-0.10.1rc1168.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
885
+ qontract_reconcile-0.10.1rc1168.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
886
+ qontract_reconcile-0.10.1rc1168.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
887
+ qontract_reconcile-0.10.1rc1168.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
@@ -1832,6 +1832,9 @@ USERS_QUERY = """
1832
1832
  gabi_instances {
1833
1833
  path
1834
1834
  }
1835
+ schedules {
1836
+ path
1837
+ }
1835
1838
  {% endif %}
1836
1839
  }
1837
1840
  }
@@ -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):
@@ -2433,7 +2433,7 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
2433
2433
  values = {}
2434
2434
  values["name"] = identifier
2435
2435
 
2436
- action = ["s3:*Object"]
2436
+ action = ["s3:*Object*"]
2437
2437
  if common_values.get("acl", "private") == "public-read":
2438
2438
  action.append("s3:PutObjectAcl")
2439
2439
  allow_object_tagging = common_values.get("allow_object_tagging", False)