qontract-reconcile 0.10.1rc814__py3-none-any.whl → 0.10.1rc816__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.1rc814
3
+ Version: 0.10.1rc816
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
@@ -653,7 +653,7 @@ reconcile/utils/oc_map.py,sha256=nT69J5pdPeIDnIYjD9fwY6GkE3BMQCf-AF0rmHJuUNw,906
653
653
  reconcile/utils/ocm_base_client.py,sha256=X8qkPXfpfJdBKBtFv7zyGD33HNAEBJL8owf-ykrt-Ts,6469
654
654
  reconcile/utils/openshift_resource.py,sha256=Gxhc3oyYDCfMix7RDVvNAZX9O1bQII0KAjGsC5pu7oA,24831
655
655
  reconcile/utils/openssl.py,sha256=QVvhzhpChq_4Daf_5wE1qeZJr4thg3DDjJPn4bOPD4E,365
656
- reconcile/utils/output.py,sha256=4tObxIS_-EdJY_YCOOOmaYvHY40Q72IpYjWhjpJR1Ec,1856
656
+ reconcile/utils/output.py,sha256=I_kXYyPcN1mlZmX16ZnLNGkhhwnal640GIdIaGJd4wE,2026
657
657
  reconcile/utils/pagerduty_api.py,sha256=fcSAUez6w51woDvbm0plJW2qSw6_NXQs1Fit_KTNitc,7653
658
658
  reconcile/utils/parse_dhms_duration.py,sha256=TONpLnec5gHeF7k815YNJpQyDjXhkxZIcv9s8ffbTSY,1840
659
659
  reconcile/utils/password_validator.py,sha256=XwuWg-8CPlcuG7dl_oQ1G1h2gSVSnfMym_VkuprpWVg,2183
@@ -665,7 +665,7 @@ reconcile/utils/raw_github_api.py,sha256=ZHC-SZuAyRe1zaMoOU7Krt1-zecDxENd9c_NzQY
665
665
  reconcile/utils/repo_owners.py,sha256=j-pUjc9PuDzq7KpjNLpnhqfU8tUG4nj2WMhFp4ick7g,6629
666
666
  reconcile/utils/rest_api_base.py,sha256=X5o4idyRCDzwnF5xFwmjyoaHmM1tXSZnykTA54Z7D2Q,4006
667
667
  reconcile/utils/ruamel.py,sha256=FzL4_L0FnMOUZmgThrZSMJs5MTdXwiy-E9MZWfk8bh8,397
668
- reconcile/utils/secret_reader.py,sha256=2DeYAAQFjUULEKlLw3UDAUoND6gbqvCh9uKPtlc-0us,10403
668
+ reconcile/utils/secret_reader.py,sha256=7g4TuBxkOl2NgsuZUCRcdI_hKLP3JhXlY1byBSxWU3A,10305
669
669
  reconcile/utils/semver_helper.py,sha256=-WfPOMSA2v1h7hT3PwVf-Htg7wOsoKlQC1JdmDX2Ars,1268
670
670
  reconcile/utils/sharding.py,sha256=gkYf0lD3IUKQPEmdRJZ70mdDT1c9qWjbdP7evRsUis4,839
671
671
  reconcile/utils/slack_api.py,sha256=2t9jeCS7V3sHSMk-ByRcjmh-2uVvGELCfJqm1nu_hKI,17395
@@ -679,7 +679,7 @@ reconcile/utils/terrascript_aws_client.py,sha256=VlvIHgrZRiMFVgx6a8ZHxoiJoDwqbtO
679
679
  reconcile/utils/three_way_diff_strategy.py,sha256=nyqeQsLCoPI6e16k2CF3b9KNgQLU-rPf5RtfdUfVMwE,4468
680
680
  reconcile/utils/throughput.py,sha256=iP4UWAe2LVhDo69mPPmgo9nQ7RxHD6_GS8MZe-aSiuM,344
681
681
  reconcile/utils/unleash.py,sha256=1D56CsZfE3ShDtN3IErE1T2eeIwNmxhK-yYbCotJ99E,3601
682
- reconcile/utils/vault.py,sha256=S0eHqvZ9N3fya1E8YDaUffEvLk_fdtpzL4rvWn6f828,14991
682
+ reconcile/utils/vault.py,sha256=AYGG5aDJ7CSVhTFdZowfEg3iSQWenoAt676aGjHQMX8,14978
683
683
  reconcile/utils/vaultsecretref.py,sha256=3Ed2uBy36TzSvL0B-l4FoWQqB2SbBKDKEuUPIO608Bo,931
684
684
  reconcile/utils/vcs.py,sha256=iiAWQXNftKIRoakXEOPT6ubB_ybSuInIQ6jcMxa_NKk,8558
685
685
  reconcile/utils/acs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -779,7 +779,7 @@ tools/app_interface_metrics_exporter.py,sha256=zkwkxdAUAxjdc-pzx2_oJXG25fo0Fnyd5
779
779
  tools/app_interface_reporter.py,sha256=upA-J-n-HXHKVDINRuMR7vTt-iJvQORKUVi9D3leQto,17738
780
780
  tools/glitchtip_access_reporter.py,sha256=oPBnk_YoDuljU3v0FaChzOwwnk4vap1xEE67QEjzdqs,2948
781
781
  tools/glitchtip_access_revalidation.py,sha256=8kbBJk04mkq28kWoRDDkfCGIF3GRg3pJrFAh1sW0dbk,2821
782
- tools/qontract_cli.py,sha256=PiT1dKAegpt_S-rALEQNEG7CKcgY5sPOY6haZEnxBzs,114860
782
+ tools/qontract_cli.py,sha256=tAM6OXJkPnbSvZWOuhWQs9oKpL6Fn7qMEEirzCeuUY8,115006
783
783
  tools/sd_app_sre_alert_report.py,sha256=e9vAdyenUz2f5c8-z-5WY0wv-SJ9aePKDH2r4IwB6pc,5063
784
784
  tools/template_validation.py,sha256=-U-lTGeLaci8yWPEblCJeev2DOlY1jM9QOOh-O1zts8,3376
785
785
  tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -806,8 +806,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
806
806
  tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jrss,4941
807
807
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
808
808
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
809
- qontract_reconcile-0.10.1rc814.dist-info/METADATA,sha256=izBuRBYFxzthBAfeBBKkMgqw9MspsZkQJ5HzbfT5tRA,2314
810
- qontract_reconcile-0.10.1rc814.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
811
- qontract_reconcile-0.10.1rc814.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
812
- qontract_reconcile-0.10.1rc814.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
813
- qontract_reconcile-0.10.1rc814.dist-info/RECORD,,
809
+ qontract_reconcile-0.10.1rc816.dist-info/METADATA,sha256=0QOFfcd_sODX-xn2jp2xwRVg-Lc3NEY3eCbA6roBlUg,2314
810
+ qontract_reconcile-0.10.1rc816.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
811
+ qontract_reconcile-0.10.1rc816.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
812
+ qontract_reconcile-0.10.1rc816.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
813
+ qontract_reconcile-0.10.1rc816.dist-info/RECORD,,
reconcile/utils/output.py CHANGED
@@ -3,7 +3,7 @@ from collections.abc import (
3
3
  Iterable,
4
4
  Mapping,
5
5
  )
6
- from typing import Union
6
+ from typing import Optional, Union
7
7
 
8
8
  import yaml
9
9
  from tabulate import tabulate
@@ -13,7 +13,7 @@ def print_output(
13
13
  options: Mapping[str, Union[str, bool]],
14
14
  content: list[dict],
15
15
  columns: Iterable[str] = (),
16
- ):
16
+ ) -> Optional[str]:
17
17
  if options["sort"]:
18
18
  content.sort(key=lambda c: tuple(c.values()))
19
19
  if options.get("to_string"):
@@ -23,17 +23,24 @@ def print_output(
23
23
 
24
24
  output = options["output"]
25
25
 
26
+ formatted_content = None
26
27
  if output == "table":
27
- print_table(content, columns)
28
+ formatted_content = format_table(content, columns)
29
+ print(formatted_content)
28
30
  elif output == "md":
29
- print_table(content, columns, table_format="github")
31
+ formatted_content = format_table(content, columns, table_format="github")
32
+ print(formatted_content)
30
33
  elif output == "json":
31
- print(json.dumps(content))
34
+ formatted_content = json.dumps(content)
35
+ print(formatted_content)
32
36
  elif output == "yaml":
33
- print(yaml.dump(content))
37
+ formatted_content = yaml.dump(content)
38
+ print(formatted_content)
34
39
  else:
35
40
  pass # error
36
41
 
42
+ return formatted_content
43
+
37
44
 
38
45
  def format_table(content, columns, table_format="simple") -> str:
39
46
  headers = [column.upper() for column in columns]
@@ -58,7 +65,3 @@ def format_table(content, columns, table_format="simple") -> str:
58
65
  row_data.append(cell)
59
66
  table_data.append(row_data)
60
67
  return tabulate(table_data, headers=headers, tablefmt=table_format)
61
-
62
-
63
- def print_table(content, columns, table_format="simple"):
64
- print(format_table(content, columns, table_format))
@@ -12,7 +12,6 @@ from typing import (
12
12
  )
13
13
 
14
14
  from hvac.exceptions import Forbidden
15
- from sretoolbox.utils import retry
16
15
 
17
16
  from reconcile.utils import (
18
17
  config,
@@ -152,7 +151,6 @@ class VaultSecretReader(SecretReaderBase):
152
151
  self._vault_client = VaultClient()
153
152
  return self._vault_client
154
153
 
155
- @retry()
156
154
  def _read_all(
157
155
  self, path: str, field: str, format: Optional[str], version: Optional[int]
158
156
  ) -> dict[str, str]:
@@ -173,10 +171,9 @@ class VaultSecretReader(SecretReaderBase):
173
171
  raise SecretNotFound(*e.args) from e
174
172
  return data
175
173
 
176
- @retry()
177
174
  def _read(
178
175
  self, path: str, field: str, format: Optional[str], version: Optional[int]
179
- ) -> dict[str, str]:
176
+ ) -> str:
180
177
  try:
181
178
  data = self.vault_client.read( # type: ignore[attr-defined] # mypy doesn't recognize the VaultClient.__new__ method
182
179
  self._parameters_to_dict(
@@ -259,7 +256,6 @@ class SecretReader(SecretReaderBase):
259
256
  self._vault_client = VaultClient()
260
257
  return self._vault_client
261
258
 
262
- @retry()
263
259
  def _read(
264
260
  self, path: str, field: str, format: Optional[str], version: Optional[int]
265
261
  ) -> str:
@@ -295,7 +291,6 @@ class SecretReader(SecretReaderBase):
295
291
 
296
292
  return data
297
293
 
298
- @retry()
299
294
  def _read_all(
300
295
  self, path: str, field: str, format: Optional[str], version: Optional[int]
301
296
  ) -> dict[str, str]:
reconcile/utils/vault.py CHANGED
@@ -191,7 +191,6 @@ class _VaultClient:
191
191
 
192
192
  return data, version
193
193
 
194
- @retry()
195
194
  def read_all(self, secret: Mapping) -> dict:
196
195
  """Returns a dictionary of keys and values in a Vault secret.
197
196
 
tools/qontract_cli.py CHANGED
@@ -2063,7 +2063,10 @@ def app_interface_review_queue(ctx) -> None:
2063
2063
 
2064
2064
  queue_data.sort(key=itemgetter("updated_at"))
2065
2065
  ctx.obj["options"]["sort"] = False # do not sort
2066
- print_output(ctx.obj["options"], queue_data, columns)
2066
+ text = print_output(ctx.obj["options"], queue_data, columns)
2067
+ if text:
2068
+ slack = slackapi_from_queries("app-interface-review-queue")
2069
+ slack.chat_post_message("```\n" + text + "\n```")
2067
2070
 
2068
2071
 
2069
2072
  @get.command()