-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZOOKEEPER-4775 Rewrite check_zookeeper from py2 to py3 #2094
base: branch-3.9
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Thank you
I have created this JIRA for you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested by ./check_zookeeper.py --servers 127.0.0.1:2180
with Python 3.8.9
Server: 127.0.0.1:2180
zk_outstanding_tls_handshake 0.0
zk_diff_count 0.0
..............................................................................
zk_sync_process_time{quantile="0.5"} 0.0
zk_snapshottime_count 1.0
Ennnn, I need to test check_zookeeper.py3
@@ -0,0 +1,404 @@ | |||
#! /usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check_zookeeper.py3
should keep the same permission as check_zookeeper.py:
-rwxr-xr-x@ 1 maoling staff 13057 Jun 20 2022 check_zookeeper.py*
otherwise: permission denied: ./check_zookeeper.py3
print ('Server:'), server | ||
|
||
for key, value in stats.items(): | ||
print ("%30s") % key, ' ', value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With python3.8, this line cannot pass the compiler. Maybe I'm wrong since I don't know python.
My chatgpt tell me it should be like print("{:<30} {}".format(key, value))
and it works well
Rewrite check_zookeeper.py to check_zookeeper.py3 which works when using python3.