From bc26b1ab8cc71e36f6d3e3aa041a7b339d41a1f1 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Sun, 10 May 2020 18:43:21 -0600 Subject: [PATCH] mgr/cephadm: ceph_default_alerts.yml can be utf-8 encoded non-ascii chars introduced by 653c3f66823 Fixes: https://tracker.ceph.com/issues/45458 Signed-off-by: Michael Fritch --- src/pybind/mgr/cephadm/services/monitoring.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/services/monitoring.py b/src/pybind/mgr/cephadm/services/monitoring.py index 242afdc390f..e3ca8a804f6 100644 --- a/src/pybind/mgr/cephadm/services/monitoring.py +++ b/src/pybind/mgr/cephadm/services/monitoring.py @@ -263,7 +263,7 @@ scrape_configs: # include alerts, if present in the container if os.path.exists(self.mgr.prometheus_alerts_path): - with open(self.mgr.prometheus_alerts_path, "r") as f: + with open(self.mgr.prometheus_alerts_path, 'r', encoding='utf-8') as f: alerts = f.read() r['files']['/etc/prometheus/alerting/ceph_alerts.yml'] = alerts -- 2.39.5