]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: ceph_default_alerts.yml can be utf-8 encoded
authorMichael Fritch <mfritch@suse.com>
Mon, 11 May 2020 00:43:21 +0000 (18:43 -0600)
committerSebastian Wagner <sebastian.wagner@suse.com>
Thu, 21 May 2020 21:33:18 +0000 (23:33 +0200)
non-ascii chars introduced by 653c3f66823

Fixes: https://tracker.ceph.com/issues/45458
Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit bc26b1ab8cc71e36f6d3e3aa041a7b339d41a1f1)

src/pybind/mgr/cephadm/services/monitoring.py

index 242afdc390fe529a8033cbd91b890db40f43f888..e3ca8a804f65b187359bf046711e0f86c5703cb8 100644 (file)
@@ -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