You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/09/10 20:33:32 UTC

[GitHub] sijie closed pull request #2552: Fix dashboard to work with python3.

sijie closed pull request #2552: Fix dashboard to work with python3.
URL: https://github.com/apache/incubator-pulsar/pull/2552
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/dashboard/django/collector.py b/dashboard/django/collector.py
index 76c0646df9..c8c3b13cfc 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 426e9b1b6e..9ab6859d11 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')
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services