qontract-reconcile 0.10.2.dev256__py3-none-any.whl → 0.10.2.dev258__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.
Files changed (96) hide show
  1. {qontract_reconcile-0.10.2.dev256.dist-info → qontract_reconcile-0.10.2.dev258.dist-info}/METADATA +1 -1
  2. {qontract_reconcile-0.10.2.dev256.dist-info → qontract_reconcile-0.10.2.dev258.dist-info}/RECORD +96 -95
  3. reconcile/aus/advanced_upgrade_service.py +1 -1
  4. reconcile/aus/base.py +2 -2
  5. reconcile/aus/version_gates/sts_version_gate_handler.py +2 -2
  6. reconcile/aws_account_manager/reconciler.py +22 -20
  7. reconcile/aws_iam_keys.py +5 -5
  8. reconcile/aws_iam_password_reset.py +5 -5
  9. reconcile/aws_saml_roles/integration.py +5 -5
  10. reconcile/aws_version_sync/integration.py +4 -3
  11. reconcile/cli.py +16 -12
  12. reconcile/closedbox_endpoint_monitoring_base.py +1 -0
  13. reconcile/database_access_manager.py +4 -4
  14. reconcile/dynatrace_token_provider/integration.py +2 -2
  15. reconcile/external_resources/manager.py +2 -2
  16. reconcile/external_resources/model.py +1 -1
  17. reconcile/external_resources/secrets_sync.py +2 -2
  18. reconcile/gabi_authorized_users.py +3 -3
  19. reconcile/github_org.py +2 -2
  20. reconcile/gitlab_housekeeping.py +1 -1
  21. reconcile/gitlab_mr_sqs_consumer.py +1 -1
  22. reconcile/glitchtip/integration.py +2 -2
  23. reconcile/jenkins_worker_fleets.py +5 -5
  24. reconcile/ldap_groups/integration.py +3 -3
  25. reconcile/ocm_clusters.py +2 -2
  26. reconcile/ocm_internal_notifications/integration.py +2 -2
  27. reconcile/ocm_labels/integration.py +3 -2
  28. reconcile/openshift_base.py +12 -11
  29. reconcile/openshift_cluster_bots.py +2 -2
  30. reconcile/openshift_resources_base.py +3 -3
  31. reconcile/openshift_rhcs_certs.py +2 -2
  32. reconcile/openshift_saas_deploy.py +1 -1
  33. reconcile/quay_membership.py +4 -4
  34. reconcile/rhidp/common.py +3 -2
  35. reconcile/run_integration.py +7 -4
  36. reconcile/saas_auto_promotions_manager/dependencies.py +95 -0
  37. reconcile/saas_auto_promotions_manager/integration.py +85 -165
  38. reconcile/skupper_network/integration.py +3 -3
  39. reconcile/slack_usergroups.py +4 -4
  40. reconcile/status_board.py +3 -3
  41. reconcile/terraform_cloudflare_dns.py +5 -5
  42. reconcile/terraform_cloudflare_users.py +15 -17
  43. reconcile/terraform_resources.py +6 -6
  44. reconcile/terraform_vpc_peerings.py +9 -9
  45. reconcile/unleash_feature_toggles/integration.py +1 -1
  46. reconcile/utils/aggregated_list.py +2 -2
  47. reconcile/utils/aws_api_typed/iam.py +2 -2
  48. reconcile/utils/aws_api_typed/organization.py +4 -4
  49. reconcile/utils/aws_api_typed/service_quotas.py +4 -4
  50. reconcile/utils/aws_api_typed/support.py +9 -9
  51. reconcile/utils/aws_helper.py +1 -1
  52. reconcile/utils/config.py +8 -4
  53. reconcile/utils/deadmanssnitch_api.py +2 -4
  54. reconcile/utils/glitchtip/models.py +18 -12
  55. reconcile/utils/gql.py +4 -4
  56. reconcile/utils/internal_groups/client.py +2 -2
  57. reconcile/utils/jinja2/utils.py +7 -3
  58. reconcile/utils/jjb_client.py +2 -2
  59. reconcile/utils/models.py +2 -1
  60. reconcile/utils/mr/__init__.py +3 -3
  61. reconcile/utils/mr/app_interface_reporter.py +2 -2
  62. reconcile/utils/mr/aws_access.py +5 -2
  63. reconcile/utils/mr/base.py +3 -3
  64. reconcile/utils/mr/user_maintenance.py +1 -1
  65. reconcile/utils/oc.py +11 -11
  66. reconcile/utils/oc_connection_parameters.py +4 -4
  67. reconcile/utils/ocm/base.py +3 -3
  68. reconcile/utils/ocm/products.py +8 -8
  69. reconcile/utils/ocm/search_filters.py +2 -2
  70. reconcile/utils/openshift_resource.py +21 -18
  71. reconcile/utils/pagerduty_api.py +5 -5
  72. reconcile/utils/quay_api.py +2 -2
  73. reconcile/utils/rosa/rosa_cli.py +1 -1
  74. reconcile/utils/rosa/session.py +2 -2
  75. reconcile/utils/runtime/desired_state_diff.py +7 -7
  76. reconcile/utils/saasherder/interfaces.py +1 -0
  77. reconcile/utils/saasherder/models.py +1 -1
  78. reconcile/utils/saasherder/saasherder.py +1 -1
  79. reconcile/utils/secret_reader.py +20 -20
  80. reconcile/utils/slack_api.py +5 -5
  81. reconcile/utils/slo_document_manager.py +6 -6
  82. reconcile/utils/state.py +8 -8
  83. reconcile/utils/terraform_client.py +3 -3
  84. reconcile/utils/terrascript/cloudflare_client.py +2 -2
  85. reconcile/utils/terrascript/cloudflare_resources.py +1 -0
  86. reconcile/utils/terrascript_aws_client.py +12 -11
  87. reconcile/utils/vault.py +22 -22
  88. reconcile/vault_replication.py +15 -15
  89. tools/cli_commands/erv2.py +3 -2
  90. tools/cli_commands/gpg_encrypt.py +9 -9
  91. tools/cli_commands/systems_and_tools.py +1 -1
  92. tools/qontract_cli.py +13 -14
  93. tools/saas_promotion_state/saas_promotion_state.py +4 -4
  94. tools/template_validation.py +5 -5
  95. {qontract_reconcile-0.10.2.dev256.dist-info → qontract_reconcile-0.10.2.dev258.dist-info}/WHEEL +0 -0
  96. {qontract_reconcile-0.10.2.dev256.dist-info → qontract_reconcile-0.10.2.dev258.dist-info}/entry_points.txt +0 -0
@@ -23,15 +23,15 @@ class GPGEncryptCommandData:
23
23
  target_user: str = ""
24
24
 
25
25
 
26
- class UserException(Exception):
26
+ class UserError(Exception):
27
27
  pass
28
28
 
29
29
 
30
- class ArgumentException(Exception):
30
+ class ArgumentError(Exception):
31
31
  pass
32
32
 
33
33
 
34
- class OpenshiftException(Exception):
34
+ class OpenshiftError(Exception):
35
35
  pass
36
36
 
37
37
 
@@ -51,7 +51,7 @@ class GPGEncryptCommand:
51
51
  def _fetch_oc_secret(self) -> str:
52
52
  parts = self._command_data.openshift_path.split("/")
53
53
  if len(parts) != 3:
54
- raise ArgumentException(
54
+ raise ArgumentError(
55
55
  f"Wrong format! --openshift-path must be of format {{cluster}}/{{namespace}}/{{secret}}. Got {self._command_data.openshift_path}"
56
56
  )
57
57
  cluster_name, namespace, secret = parts
@@ -62,7 +62,7 @@ class GPGEncryptCommand:
62
62
  )
63
63
 
64
64
  if not clusters:
65
- raise ArgumentException(f"No cluster found with name '{cluster_name}'")
65
+ raise ArgumentError(f"No cluster found with name '{cluster_name}'")
66
66
 
67
67
  settings = queries.get_app_interface_settings()
68
68
  data = {}
@@ -81,7 +81,7 @@ class GPGEncryptCommand:
81
81
  "data"
82
82
  ]
83
83
  except Exception as e:
84
- raise OpenshiftException(
84
+ raise OpenshiftError(
85
85
  f"Could not fetch secret from Openshift cluster {cluster_name}"
86
86
  ) from e
87
87
 
@@ -107,7 +107,7 @@ class GPGEncryptCommand:
107
107
  return self._fetch_local_file_secret()
108
108
  if self._command_data.openshift_path:
109
109
  return self._fetch_oc_secret()
110
- raise ArgumentException(
110
+ raise ArgumentError(
111
111
  f"No argument given which defines how to fetch the secret {self._command_data}"
112
112
  )
113
113
 
@@ -120,13 +120,13 @@ class GPGEncryptCommand:
120
120
  ),
121
121
  )
122
122
  if len(users) != 1:
123
- raise UserException(
123
+ raise UserError(
124
124
  f"Expected to find exactly one user for '{target_user}', but found {len(users)}."
125
125
  )
126
126
  user = users[0]
127
127
 
128
128
  if "public_gpg_key" not in user:
129
- raise UserException(
129
+ raise UserError(
130
130
  f"User '{target_user}' does not have an associated GPG key."
131
131
  )
132
132
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- # ruff: noqa: PLC0415 - `import` should be at the top-level of a file
2
+
3
3
 
4
4
  from typing import (
5
5
  Any,
tools/qontract_cli.py CHANGED
@@ -1066,14 +1066,14 @@ def network_reservations(ctx: click.Context) -> None:
1066
1066
  return url
1067
1067
 
1068
1068
  for network in get_networks():
1069
- parentAddress = "none"
1069
+ parent_address = "none"
1070
1070
  if network.parent_network:
1071
- parentAddress = network.parent_network.network_address
1071
+ parent_address = network.parent_network.network_address
1072
1072
  if network.in_use_by and network.in_use_by.vpc:
1073
1073
  network_table.append({
1074
1074
  "name": network.name,
1075
1075
  "network Address": network.network_address,
1076
- "parent Network": parentAddress,
1076
+ "parent Network": parent_address,
1077
1077
  "Account Name": network.in_use_by.vpc.account.name,
1078
1078
  "Account UID": network.in_use_by.vpc.account.uid,
1079
1079
  "Console Login URL": md_link(network.in_use_by.vpc.account.console_url),
@@ -1082,7 +1082,7 @@ def network_reservations(ctx: click.Context) -> None:
1082
1082
  network_table.append({
1083
1083
  "name": network.name,
1084
1084
  "network Address": network.network_address,
1085
- "parent Network": parentAddress,
1085
+ "parent Network": parent_address,
1086
1086
  "Account Name": "Unclaimed network",
1087
1087
  "Account UID": "Unclaimed network",
1088
1088
  "Console Login URL": "Unclaimed network",
@@ -1857,8 +1857,8 @@ You can view the source of this Markdown to extract the JSON data.
1857
1857
  @get.command
1858
1858
  @click.pass_context
1859
1859
  def rds_recommendations(ctx: click.Context) -> None:
1860
- IGNORED_STATUSES = ("resolved",)
1861
- IGNORED_SEVERITIES = ("informational",)
1860
+ ignored_statuses = ("resolved",)
1861
+ ignored_severities = ("informational",)
1862
1862
 
1863
1863
  settings = queries.get_app_interface_settings()
1864
1864
 
@@ -1919,8 +1919,8 @@ def rds_recommendations(ctx: click.Context) -> None:
1919
1919
  "Description": rec["Description"].replace("\n", " "),
1920
1920
  }
1921
1921
  for rec in db_recommendations
1922
- if rec.get("Status") not in IGNORED_STATUSES
1923
- and rec.get("Severity") not in IGNORED_SEVERITIES
1922
+ if rec.get("Status") not in ignored_statuses
1923
+ and rec.get("Severity") not in ignored_severities
1924
1924
  ]
1925
1925
  # If we have no recommendations to show, skip
1926
1926
  if not recommendations:
@@ -2678,7 +2678,6 @@ def ec2_jenkins_workers(
2678
2678
  ec2 = boto3.resource("ec2")
2679
2679
  results = []
2680
2680
  now = datetime.now(UTC)
2681
- DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
2682
2681
  columns = [
2683
2682
  "type",
2684
2683
  "id",
@@ -2723,7 +2722,7 @@ def ec2_jenkins_workers(
2723
2722
  "id": f"[{instance.id}]({url})",
2724
2723
  "IP": instance.private_ip_address,
2725
2724
  "instance type": instance.instance_type,
2726
- "launch time (utc)": f"{instance.launch_time.strftime(DATE_FORMAT)} {launch_emoji}",
2725
+ "launch time (utc)": f"{instance.launch_time.strftime('%Y-%m-%d %H:%M:%S')} {launch_emoji}",
2727
2726
  "OS": os,
2728
2727
  "AMI": f"[{image.name}]({commit_url})",
2729
2728
  }
@@ -2801,12 +2800,12 @@ def slo_document_services(ctx: click.Context, status_board_instance: str) -> Non
2801
2800
  @click.argument("file_path")
2802
2801
  @click.pass_context
2803
2802
  def alerts(ctx: click.Context, file_path: str) -> None:
2804
- BIG_NUMBER = 10
2803
+ big_number = 10
2805
2804
 
2806
2805
  def sort_by_threshold(item: dict[str, str]) -> int:
2807
2806
  threshold = item["threshold"]
2808
2807
  if not threshold:
2809
- return BIG_NUMBER * 60 * 24
2808
+ return big_number * 60 * 24
2810
2809
  value = int(threshold[:-1])
2811
2810
  unit = threshold[-1]
2812
2811
  match unit:
@@ -2817,7 +2816,7 @@ def alerts(ctx: click.Context, file_path: str) -> None:
2817
2816
  case "d":
2818
2817
  return value * 60 * 24
2819
2818
  case _:
2820
- return BIG_NUMBER * 60 * 24
2819
+ return big_number * 60 * 24
2821
2820
 
2822
2821
  def sort_by_severity(item: dict[str, str]) -> int:
2823
2822
  match item["severity"].lower():
@@ -2828,7 +2827,7 @@ def alerts(ctx: click.Context, file_path: str) -> None:
2828
2827
  case "info":
2829
2828
  return 2
2830
2829
  case _:
2831
- return BIG_NUMBER
2830
+ return big_number
2832
2831
 
2833
2832
  with open(file_path, encoding="locale") as f:
2834
2833
  content = json.loads(f.read())
@@ -14,11 +14,11 @@ from reconcile.utils.secret_reader import create_secret_reader
14
14
  from reconcile.utils.state import init_state
15
15
 
16
16
 
17
- class SaasPromotionStateException(Exception):
17
+ class SaasPromotionStateError(Exception):
18
18
  pass
19
19
 
20
20
 
21
- class SaasPromotionStateMissingException(Exception):
21
+ class SaasPromotionStateMissingError(Exception):
22
22
  pass
23
23
 
24
24
 
@@ -72,12 +72,12 @@ class SaasPromotionState:
72
72
  )
73
73
 
74
74
  if not current_data:
75
- raise SaasPromotionStateMissingException(
75
+ raise SaasPromotionStateMissingError(
76
76
  f"No promotion state in S3 for given {publisher_uid=} {sha=} {channel=}"
77
77
  )
78
78
 
79
79
  if current_data.success:
80
- raise SaasPromotionStateException(
80
+ raise SaasPromotionStateError(
81
81
  f"The current promotion state is already marked successful for given {publisher_uid=} {sha=} {channel=}",
82
82
  current_data,
83
83
  )
@@ -57,17 +57,17 @@ def print_test_diffs(diffs: list[TemplateDiff]) -> None:
57
57
  def main(templates: tuple[str]) -> None:
58
58
  for template_path in templates:
59
59
  okay = True
60
- templateRaw = load_clean_yaml(template_path)
60
+ template_raw = load_clean_yaml(template_path)
61
61
 
62
62
  tests = []
63
- for testRaw in templateRaw["templateTest"]:
64
- test_yaml = load_clean_yaml(testRaw["$ref"])
63
+ for test_raw in template_raw["templateTest"]:
64
+ test_yaml = load_clean_yaml(test_raw["$ref"])
65
65
  variables = json.dumps(test_yaml["variables"])
66
66
  test_yaml["variables"] = variables
67
67
  tests.append(test_yaml)
68
68
 
69
- templateRaw["templateTest"] = tests
70
- template: TemplateV1 = TemplateV1(**data_default_none(TemplateV1, templateRaw))
69
+ template_raw["templateTest"] = tests
70
+ template: TemplateV1 = TemplateV1(**data_default_none(TemplateV1, template_raw))
71
71
 
72
72
  # templates_to_validate = {}
73
73
  for test in template.template_test: