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: v16.1.0~2365^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bc26b1ab8cc71e36f6d3e3aa041a7b339d41a1f1;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 --- diff --git a/src/pybind/mgr/cephadm/services/monitoring.py b/src/pybind/mgr/cephadm/services/monitoring.py index 242afdc390fe..e3ca8a804f65 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