This is an automated email from the ASF dual-hosted git repository. sijie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git
The following commit(s) were added to refs/heads/master by this push: new fc2d1d3 Fix dashboard to work with python3. (#2552) fc2d1d3 is described below commit fc2d1d3da7ffb8bb47e30ec49c07cf8d9f735246 Author: cckellogg <cckell...@gmail.com> AuthorDate: Mon Sep 10 13:33:29 2018 -0700 Fix dashboard to work with python3. (#2552) ### Motivation Make dashboard work with python 3. --- dashboard/django/collector.py | 10 +++++----- dashboard/django/stats/views.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dashboard/django/collector.py b/dashboard/django/collector.py index 76c0646..c8c3b13 100755 --- a/dashboard/django/collector.py +++ b/dashboard/django/collector.py @@ -63,7 +63,7 @@ def fetch_broker_stats(cluster, broker_url, timestamp): def _fetch_broker_stats(cluster, broker_host_port, timestamp): broker_url = 'http://%s/' % broker_host_port - print ' Getting stats for %s' % broker_host_port + print(' Getting stats for %s' % broker_host_port) broker, _ = Broker.objects.get_or_create( url = broker_host_port, @@ -262,7 +262,7 @@ def fetch_stats(): if cluster_name == 'global': continue cluster_url = get(args.serviceUrl, '/admin/clusters/' + cluster_name)['serviceUrl'] - print 'Cluster:', cluster_name, '->', cluster_url + print('Cluster:', cluster_name, '->', cluster_url) cluster, created = Cluster.objects.get_or_create(name=cluster_name) if cluster_url != cluster.serviceUrl: cluster.serviceUrl = cluster_url @@ -275,7 +275,7 @@ def fetch_stats(): f = pool.apply_async(fetch_broker_stats, (cluster, broker_host_port, timestamp)) futures.append(f) except Exception as e: - print 'ERROR: ', e + print('ERROR: ', e) pool.close() @@ -300,10 +300,10 @@ def purge_db(): Consumer.objects.filter(timestamp__lt = threshold).delete() def collect_and_purge(): - print '-- Starting stats collection' + print('-- Starting stats collection') fetch_stats() purge_db() - print '-- Finished collecting stats' + print('-- Finished collecting stats') if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dashboard.settings") diff --git a/dashboard/django/stats/views.py b/dashboard/django/stats/views.py index 426e9b1..9ab6859 100644 --- a/dashboard/django/stats/views.py +++ b/dashboard/django/stats/views.py @@ -56,7 +56,7 @@ def home(request): throughputOut = Sum('namespace__topic__msgThroughputOut'), ) - print properties.query + print(properties.query) properties = Table(request, properties, default_sort='name')