From: Michael Fritch Date: Mon, 11 May 2020 00:43:21 +0000 (-0600) Subject: mgr/cephadm: ceph_default_alerts.yml can be utf-8 encoded X-Git-Tag: v15.2.4~73^2~40 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=397e40686f01065b1eb3e67ddb5f66b129156015;p=ceph.git 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 (cherry picked from commit bc26b1ab8cc71e36f6d3e3aa041a7b339d41a1f1) --- 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