qontract-reconcile 0.10.1rc815__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.1rc815
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
@@ -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.1rc815.dist-info/METADATA,sha256=n6ChIS4befcxQkIjGA6Bc90CIJ7DeX9szDlvPFaV5Hc,2314
810
- qontract_reconcile-0.10.1rc815.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
811
- qontract_reconcile-0.10.1rc815.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
812
- qontract_reconcile-0.10.1rc815.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
813
- qontract_reconcile-0.10.1rc815.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))
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()