Skip to content
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

Open
wants to merge 1 commit into
base: branch-3.9
Choose a base branch
from

Conversation

rkuijk
Copy link

@rkuijk rkuijk commented Nov 30, 2023

Rewrite check_zookeeper.py to check_zookeeper.py3 which works when using python3.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Thank you

@eolivelli
Copy link
Contributor

I have created this JIRA for you
https://issues.apache.org/jira/browse/ZOOKEEPER-4775

@eolivelli eolivelli changed the title Rewrite check_zookeeper from py2 to py3 ZOOKEEPER-4775 Rewrite check_zookeeper from py2 to py3 Nov 30, 2023
Copy link
Member

@maoling maoling left a 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
Copy link
Member

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants