diff options
author | Kefu Chai <kchai@redhat.com> | 2020-06-28 13:15:25 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2020-07-05 04:58:28 +0200 |
commit | cf7632cfd52e351fa78e49dfbc41a9fdae0247fe (patch) | |
tree | 9154cd4c69b1e38d3a2aba463635586dd55ce639 /src/pybind/mgr/dashboard/ci | |
parent | pybind: drop py2 support (diff) | |
download | ceph-cf7632cfd52e351fa78e49dfbc41a9fdae0247fe.tar.xz ceph-cf7632cfd52e351fa78e49dfbc41a9fdae0247fe.zip |
pybind/mgr/dashboard: drop py2 support
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/pybind/mgr/dashboard/ci')
-rw-r--r-- | src/pybind/mgr/dashboard/ci/check_grafana_uids.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/pybind/mgr/dashboard/ci/check_grafana_uids.py b/src/pybind/mgr/dashboard/ci/check_grafana_uids.py index fac3b995397..ab27ab66399 100644 --- a/src/pybind/mgr/dashboard/ci/check_grafana_uids.py +++ b/src/pybind/mgr/dashboard/ci/check_grafana_uids.py @@ -18,18 +18,13 @@ import copy import json import os -import six -from six.moves.html_parser import HTMLParser +from html.parser import HTMLParser class TemplateParser(HTMLParser): def __init__(self, _file, search_tag): - if six.PY3: - super(TemplateParser, self).__init__() - else: - # HTMLParser is not a new-style class in py2 - HTMLParser.__init__(self) + super().__init__() self.search_tag = search_tag self.file = _file self.parsed_data = [] @@ -54,10 +49,6 @@ class TemplateParser(HTMLParser): exit(error_msg) -def stdout(msg): - six.print_(msg) - - def get_files(base_dir, file_ext): result = [] for root, _, files in os.walk(base_dir): @@ -132,7 +123,7 @@ def main(): exit(error_msg) if verbose: - stdout('Found mappings:') + print('Found mappings:') no_dashboard_tags = [] for tag in tags: uid = tag['attrs']['uid'] @@ -144,7 +135,7 @@ def main(): format(uid, tag['file'], tag['line'], grafana_dashboards[uid]['title'], grafana_dashboards[uid]['file']) - stdout(msg) + print(msg) if no_dashboard_tags: title = ('Checking Grafana dashboards UIDs: ERROR\n' @@ -156,7 +147,7 @@ def main(): error_msg = title + '\n'.join(lines) exit(error_msg) else: - stdout('Checking Grafana dashboards UIDs: OK') + print('Checking Grafana dashboards UIDs: OK') if __name__ == '__main__': |