qontract-reconcile 0.10.1rc744__py3-none-any.whl → 0.10.1rc745__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.1rc744
3
+ Version: 0.10.1rc745
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
@@ -115,7 +115,7 @@ reconcile/terraform_cloudflare_users.py,sha256=1EbTHwJgiPkJpMP-Ag340QNgGK3mXn3dc
115
115
  reconcile/terraform_repo.py,sha256=c0GZFuY3rCm6VHjHqYbsgOHrEkRWKF_1LrMThsn2XDw,16127
116
116
  reconcile/terraform_resources.py,sha256=BN8XuJwjOt1ztruEAHydkd0YiBlb3fHZ7n0snZtRhck,19356
117
117
  reconcile/terraform_tgw_attachments.py,sha256=k9Lf0ST65gmI6aUV6HnvxSGcKL7MGx_lN22OXuRGH9Y,16224
118
- reconcile/terraform_users.py,sha256=L921n4bD6-XbJeiiMKUI3quRacIkHlFEyvpi5Dcli_8,10374
118
+ reconcile/terraform_users.py,sha256=9rgbM572LfmOSnV3uCP20G_Cw6T7due94g8rhhiz904,10225
119
119
  reconcile/terraform_vpc_peerings.py,sha256=rnDH1u93OyzrBM8Hib0HwSnlxZtx4ScRQaZAcn3mx-k,25402
120
120
  reconcile/vault_replication.py,sha256=79GZ_kCimPoQcxkdhkWTQxPOAa46E0mNhf05s_Mk5so,17385
121
121
  reconcile/vpc_peerings_validator.py,sha256=Kv22HJVlTW9l9GB2eXwjPWqdDbr_VuvQBNPttox6s5o,7177
@@ -504,7 +504,7 @@ reconcile/test/test_terraform_cloudflare_users.py,sha256=RAFtMMdqZha3jNnNNsqbNQQ
504
504
  reconcile/test/test_terraform_repo.py,sha256=soKFJfF8tWIimDs39RQl3Hnh-Od-bR4PfnEA2s1UprM,11552
505
505
  reconcile/test/test_terraform_resources.py,sha256=EFCqPI5_G8hPRh1zmnU91o8wMeT2qK1CabDUa_X1rSk,15283
506
506
  reconcile/test/test_terraform_tgw_attachments.py,sha256=cAq6exc-K-jtLla1CZUZQzVnBkyDnIlL7jybnddhLKc,36861
507
- reconcile/test/test_terraform_users.py,sha256=Xn4y6EcxnNQb6XcPoOhz_Ikxmh9Nrsu88OM1scN9hzY,5434
507
+ reconcile/test/test_terraform_users.py,sha256=XOAfGvITCJPI1LTlISmHbA4ONMQMkxYUMTsny7pQCFw,4319
508
508
  reconcile/test/test_terraform_vpc_peerings.py,sha256=ubcsKh0TrUIwuI1-W3ETIgzsFvzAyeoFmEJFC-IK6JY,20538
509
509
  reconcile/test/test_terraform_vpc_peerings_build_desired_state.py,sha256=DAfpb12I0PlqnuVUHK2vh4LH4d1OylT3H2GE_3TGZZI,47852
510
510
  reconcile/test/test_three_way_diff_strategy.py,sha256=2fjEqE2w4pIzKq18PRcADTSe01aGwsZfMGloU8xfNaE,3346
@@ -777,8 +777,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
777
777
  tools/test/test_qontract_cli.py,sha256=w2l4BHB09k1d-BGJ1jBUNCqDv7zkqYrMHojQXg-21kQ,4155
778
778
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
779
779
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
780
- qontract_reconcile-0.10.1rc744.dist-info/METADATA,sha256=sIbstE_GcpNpldwcIVZDvFWxsYWgttSR6hyw9KGJai4,2382
781
- qontract_reconcile-0.10.1rc744.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
782
- qontract_reconcile-0.10.1rc744.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
783
- qontract_reconcile-0.10.1rc744.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
784
- qontract_reconcile-0.10.1rc744.dist-info/RECORD,,
780
+ qontract_reconcile-0.10.1rc745.dist-info/METADATA,sha256=K-tNwC_Bwk22pf6PCk8t7tgUuxwXMW7XSa0kPS41UmY,2382
781
+ qontract_reconcile-0.10.1rc745.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
782
+ qontract_reconcile-0.10.1rc745.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
783
+ qontract_reconcile-0.10.1rc745.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
784
+ qontract_reconcile-0.10.1rc745.dist-info/RECORD,,
@@ -1,4 +1,3 @@
1
- import logging
2
1
  import sys
3
2
  from textwrap import indent
4
3
  from typing import (
@@ -113,11 +112,12 @@ def setup(
113
112
  appsre_pgp_key: Optional[str] = None,
114
113
  account_name: Optional[str] = None,
115
114
  ) -> tuple[list[dict[str, Any]], dict[str, str], bool, AWSApi]:
116
- accounts = queries.get_aws_accounts(terraform_state=True)
117
- if account_name:
118
- accounts = [n for n in accounts if n["name"] == account_name]
119
- if not accounts:
120
- raise ValueError(f"aws account {account_name} is not found")
115
+ accounts = [
116
+ a
117
+ for a in queries.get_aws_accounts(terraform_state=True)
118
+ if integration_is_enabled(QONTRACT_INTEGRATION.replace("_", "-"), a)
119
+ and (not account_name or a["name"] == account_name)
120
+ ]
121
121
  roles = get_tf_roles()
122
122
  participating_aws_accounts = _filter_participating_aws_accounts(accounts, roles)
123
123
 
@@ -253,9 +253,7 @@ def run(
253
253
  )
254
254
 
255
255
  if not accounts:
256
- logging.warning(
257
- f"No participating AWS accounts found, consider disabling this integration, account name: {account_name}"
258
- )
256
+ # no enabled accounts found
259
257
  return
260
258
 
261
259
  if print_to_file:
@@ -150,29 +150,3 @@ def test_setup(
150
150
  settings=None,
151
151
  init_users=False,
152
152
  )
153
-
154
-
155
- def test_empty_run(
156
- mocker: MockerFixture,
157
- pgp_reencryption_settings: PgpReencryptionSettingsQueryData,
158
- test_aws_account: dict,
159
- gql_api_builder: Callable[..., GqlApi],
160
- ) -> None:
161
- mocked_gql_api = gql_api_builder({"roles": []})
162
- mocker.patch("reconcile.terraform_users.gql").get_api.return_value = mocked_gql_api
163
- mocker.patch(
164
- "reconcile.terraform_users.query"
165
- ).return_value = pgp_reencryption_settings
166
- mocker.patch("reconcile.terraform_users.sys")
167
- mocked_queries = mocker.patch("reconcile.terraform_users.queries")
168
- mocked_queries.get_aws_accounts.return_value = [test_aws_account]
169
- mocked_queries.get_app_interface_settings.return_value = None
170
- mocker.patch("reconcile.terraform_users.Terrascript", autospec=True)
171
- mocker.patch("reconcile.terraform_users.AWSApi", autospec=True)
172
- mocked_logging = mocker.patch("reconcile.terraform_users.logging")
173
-
174
- integ.run(False, send_mails=False)
175
-
176
- mocked_logging.warning.assert_called_once_with(
177
- "No participating AWS accounts found, consider disabling this integration, account name: None"
178
- )