qontract-reconcile 0.9.1rc157__py3-none-any.whl → 0.9.1rc159__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.9.1rc157
3
+ Version: 0.9.1rc159
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
@@ -56,7 +56,7 @@ reconcile/jenkins_webhooks_cleaner.py,sha256=GmOCaFmxF8CYEevMJwgm8KS69oiGG3tXZjL
56
56
  reconcile/jenkins_worker_fleets.py,sha256=nwlsLSly85RukBGCVsEpoc92BVxvCjJetFlpNC5OwPc,5282
57
57
  reconcile/jira_watcher.py,sha256=gus5j2m1mDTsl3CL8bDZ5Lz7KK3INztlrnyJjsjGwv4,3574
58
58
  reconcile/kafka_clusters.py,sha256=k0MkqHDJUH8tp6B46mIYmRgDLtxpp5Zcmf41XLjHFIk,7238
59
- reconcile/ldap_users.py,sha256=1IlMg-FCRzXWbr5eyBi0CLr1XED47XS6Xg6egmJvSnQ,2683
59
+ reconcile/ldap_users.py,sha256=dD7n7JrVQlxqN6gfdqdKpVsyCjTGhRwL0nyA3gsfXxs,2869
60
60
  reconcile/mr_client_gateway.py,sha256=WhjMd-sIXDFCV8-rt8CEjurJ5OYB1pOD0K3o0tZRXQg,1885
61
61
  reconcile/ocm_additional_routers.py,sha256=mtJYVI0HX39fr6hgOyiDaNVuwjTEH5aBbEGYeWfm5-M,3307
62
62
  reconcile/ocm_addons.py,sha256=qqAyqRBRbdZQvAcjb-QlSVyRAyQBZk6iVlgnI4jyi7s,3353
@@ -108,7 +108,7 @@ reconcile/quay_mirror.py,sha256=9pwl1gLzRpsVXF5yPULM4ET_C5F8_xPmH8Mv8AS2AfI,1340
108
108
  reconcile/quay_mirror_org.py,sha256=E1OdRe-ppxTkNCwu20iVRhEdG1fPDBroLY02NgiMN7c,10381
109
109
  reconcile/quay_permissions.py,sha256=_3PCWjNWoU7VHlYgHzUevvL_jJmEMsWfXV_nzjeiyhU,4099
110
110
  reconcile/quay_repos.py,sha256=7609RBVQihis96FNOOe-i9tCTYwcTVy4WpKAL6HpnkU,7031
111
- reconcile/queries.py,sha256=SZ0Ud0ffph6lD-UEVdjyCGXyz7zS8X8QN3FSYJ-zS5I,57742
111
+ reconcile/queries.py,sha256=GQH-PxCXkp_IWcfMbXO6YrO90zdcPGSNJ3rAQSc9G-I,57778
112
112
  reconcile/query_validator.py,sha256=oLEZIAsQCzxmmZ7b9dSw-OKuEjpI1dbVu4XfCfjpmi8,1503
113
113
  reconcile/requests_sender.py,sha256=m00QET0mh6rys5r0y5uurZS7RIylXf04HU1dTdhjt0A,3791
114
114
  reconcile/resource_scraper.py,sha256=vo1N9vLJCYWvXlTwFRIpEuWjx_39ZV9zxJlpoPq4g3U,2330
@@ -454,7 +454,7 @@ reconcile/utils/mr/labels.py,sha256=RKg8_dSQBZBoRbU-a8VH90UTYmwjFH1GodLQDsRrcDE,
454
454
  reconcile/utils/mr/notificator.py,sha256=MbXA7pgaB-CN1R1kY88MNQ27ZMXX56myqJY4jRSqDhQ,2419
455
455
  reconcile/utils/mr/ocm_update_recommended_version.py,sha256=Eb4449dIQbVDyWHbEHXekgyEV3Vq3F4hWkKSrraHKic,1531
456
456
  reconcile/utils/mr/ocm_upgrade_scheduler_org_updates.py,sha256=PDhvitkGtpJ1JYhdk7gOICQCKU3YeYNKjf4XfKxppOo,2737
457
- reconcile/utils/mr/user_maintenance.py,sha256=-JQHNiTzmHO9Jfqzfeiuw_qN9kUBspcHy3T6IWrQBcg,3030
457
+ reconcile/utils/mr/user_maintenance.py,sha256=_4VwAMJsBxD7maM7AZsMl_GjYRgQtZb_rlFXR-0U0v0,3890
458
458
  reconcile/utils/runtime/__init__.py,sha256=l9o8APZxyED5Q6ylGoLIESksQF4f3O8cdke3IdMFOTQ,108
459
459
  reconcile/utils/runtime/desired_state_diff.py,sha256=AQhJmq3CP2YOWP-KpmVtYKnhZ46sxERfbk_R6PHO-zc,8272
460
460
  reconcile/utils/runtime/environment.py,sha256=cJgCMRBeschdeKJuk_N6BhDWaOCZbo-41i2a9L9DpBE,1328
@@ -482,8 +482,8 @@ tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y
482
482
  tools/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
483
483
  tools/test/test_qontract_cli.py,sha256=awwTHEc2DWlykuqGIYM0WOBoSL0KRnOraCLk3C7izis,1401
484
484
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
485
- qontract_reconcile-0.9.1rc157.dist-info/METADATA,sha256=A1O1x1jCchhxTxSTmcxcI92FXss0Q_De1VnNM8fyHXo,2259
486
- qontract_reconcile-0.9.1rc157.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
487
- qontract_reconcile-0.9.1rc157.dist-info/entry_points.txt,sha256=3BPvsRryM1C4S_mb5kXmP5AVv-wJBzVCrOJyv6qUmc0,195
488
- qontract_reconcile-0.9.1rc157.dist-info/top_level.txt,sha256=j0CHPIc8TsVRB50wOz_jhxjjaRyCJB3NOQeXhuHS67c,34
489
- qontract_reconcile-0.9.1rc157.dist-info/RECORD,,
485
+ qontract_reconcile-0.9.1rc159.dist-info/METADATA,sha256=BDPXtXyEpfWLtV2qKYFCrPzCpS9FN4-MOl5YV6yxDAc,2259
486
+ qontract_reconcile-0.9.1rc159.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
487
+ qontract_reconcile-0.9.1rc159.dist-info/entry_points.txt,sha256=3BPvsRryM1C4S_mb5kXmP5AVv-wJBzVCrOJyv6qUmc0,195
488
+ qontract_reconcile-0.9.1rc159.dist-info/top_level.txt,sha256=j0CHPIc8TsVRB50wOz_jhxjjaRyCJB3NOQeXhuHS67c,34
489
+ qontract_reconcile-0.9.1rc159.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.38.4)
2
+ Generator: bdist_wheel (0.40.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
reconcile/ldap_users.py CHANGED
@@ -16,7 +16,7 @@ from reconcile.utils.mr.user_maintenance import PathTypes
16
16
  QONTRACT_INTEGRATION = "ldap-users"
17
17
 
18
18
 
19
- def init_users():
19
+ def init_users() -> list[dict[str, list]]:
20
20
  app_int_users = queries.get_users(refs=True)
21
21
 
22
22
  users = defaultdict(list)
@@ -33,6 +33,9 @@ def init_users():
33
33
  for g in user.get("gabi_instances"):
34
34
  item = {"type": PathTypes.GABI, "path": "data" + g["path"]}
35
35
  users[u].append(item)
36
+ for a in user.get("aws_accounts", []):
37
+ item = {"type": PathTypes.AWS_ACCOUNTS, "path": "data" + a["path"]}
38
+ users[u].append(item)
36
39
 
37
40
  return [{"username": username, "paths": paths} for username, paths in users.items()]
38
41
 
reconcile/queries.py CHANGED
@@ -1805,6 +1805,9 @@ USERS_QUERY = """
1805
1805
  pagerduty_username
1806
1806
  public_gpg_key
1807
1807
  {% if refs %}
1808
+ aws_accounts {
1809
+ path
1810
+ }
1808
1811
  requests {
1809
1812
  path
1810
1813
  }
@@ -9,6 +9,7 @@ class PathTypes:
9
9
  REQUEST = 1
10
10
  QUERY = 2
11
11
  GABI = 3
12
+ AWS_ACCOUNTS = 4
12
13
 
13
14
 
14
15
  class CreateDeleteUserAppInterface(MergeRequestBase):
@@ -53,6 +54,20 @@ class CreateDeleteUserAppInterface(MergeRequestBase):
53
54
  commit_message=self.title,
54
55
  content=new_content,
55
56
  )
57
+ elif path_type == PathTypes.AWS_ACCOUNTS:
58
+ raw_file = gitlab_cli.project.files.get(file_path=path, ref=self.branch)
59
+ content = yaml.load(raw_file.decode(), Loader=yaml.RoundTripLoader)
60
+ for reset_record in content["resetPasswords"]:
61
+ if self.username in reset_record["user"]["$ref"]:
62
+ content["resetPasswords"].remove(reset_record)
63
+ new_content = "---\n"
64
+ new_content += yaml.dump(content, Dumper=yaml.RoundTripDumper)
65
+ gitlab_cli.update_file(
66
+ branch_name=self.branch,
67
+ file_path=path,
68
+ commit_message=self.title,
69
+ content=new_content,
70
+ )
56
71
 
57
72
 
58
73
  class CreateDeleteUserInfra(MergeRequestBase):