]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: open files with UTF-8 encoding in Grafana checking script 31750/head
authorKiefer Chang <kiefer.chang@suse.com>
Wed, 20 Nov 2019 04:47:30 +0000 (12:47 +0800)
committerKiefer Chang <kiefer.chang@suse.com>
Wed, 20 Nov 2019 04:48:43 +0000 (12:48 +0800)
Fixes: https://tracker.ceph.com/issues/42892
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
src/pybind/mgr/dashboard/ci/check_grafana_uids.py

index 0b74d089e964ea04df2965e794a04c47147b7f40..134bb6e7fbd3242de754324f3192ff18eca32114 100644 (file)
@@ -13,6 +13,7 @@ e.g.
     python ci/<script> frontend/src/app /ceph/monitoring/grafana/dashboards
 """
 import argparse
+import codecs
 import copy
 import json
 import os
@@ -34,7 +35,7 @@ class TemplateParser(HTMLParser):
         self.parsed_data = []
 
     def parse(self):
-        with open(self.file) as f:
+        with codecs.open(self.file, encoding='UTF-8') as f:
             self.feed(f.read())
 
     def handle_starttag(self, tag, attrs):