1 Star 0 Fork 16

yaokai13/thrift

forked from src-openEuler/thrift 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
python3.patch 2.65 KB
一键复制 编辑 原始数据 按行查看 历史
yaokai13 提交于 2020-08-18 17:36 +08:00 . package init
diff --git a/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py b/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
index 4b1c257..df1c8cc 100644
--- a/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
+++ b/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
@@ -57,24 +57,24 @@ def service_ctrl(
msg = fb_status_string(status)
if (len(status_details)):
msg += " - %s" % status_details
- print msg
+ print(msg)
if (status == fb_status.ALIVE):
return 2
else:
return 3
except:
- print "Failed to get status"
+ print("Failed to get status")
return 3
# scalar commands
if command in ["version", "alive", "name"]:
try:
result = fb303_wrapper(command, port, trans_factory, prot_factory)
- print result
+ print(result)
return 0
except:
- print "failed to get ", command
+ print("failed to get ", command)
return 3
# counters
@@ -82,10 +82,10 @@ def service_ctrl(
try:
counters = fb303_wrapper('counters', port, trans_factory, prot_factory)
for counter in counters:
- print "%s: %d" % (counter, counters[counter])
+ print("%s: %d" % (counter, counters[counter]))
return 0
except:
- print "failed to get counters"
+ print("failed to get counters")
return 3
# Only root should be able to run the following commands
@@ -96,19 +96,19 @@ def service_ctrl(
fb303_wrapper(command, port, trans_factory, prot_factory)
return 0
except:
- print "failed to tell the service to ", command
+ print("failed to tell the service to ", command)
return 3
else:
if command in ["stop", "reload"]:
- print "root privileges are required to stop or reload the service."
+ print("root privileges are required to stop or reload the service.")
return 4
- print "The following commands are available:"
+ print("The following commands are available:")
for command in ["counters", "name", "version", "alive", "status"]:
- print "\t%s" % command
- print "The following commands are available for users with root privileges:"
+ print("\t%s" % command)
+ print("The following commands are available for users with root privileges:")
for command in ["stop", "reload"]:
- print "\t%s" % command
+ print("\t%s" % command)
return 0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yaokai13/thrift.git
git@gitee.com:yaokai13/thrift.git
yaokai13
thrift
thrift
master

搜索帮助