gorealis v2 refactor (#5)
* Changing default timeout for start maintenance. * Upgrading dependencies to gorealis v2 and thrift 0.12.0 * Refactored to update to gorealis v2.
This commit is contained in:
parent
ad4dd9606e
commit
6ab5c9334d
1335 changed files with 137431 additions and 61530 deletions
33
vendor/git.apache.org/thrift.git/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
generated
vendored
33
vendor/git.apache.org/thrift.git/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python
|
||||
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -19,6 +19,7 @@
|
|||
# under the License.
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import os
|
||||
from optparse import OptionParser
|
||||
|
@ -57,24 +58,20 @@ def service_ctrl(
|
|||
msg = fb_status_string(status)
|
||||
if (len(status_details)):
|
||||
msg += " - %s" % status_details
|
||||
print msg
|
||||
|
||||
if (status == fb_status.ALIVE):
|
||||
return 2
|
||||
else:
|
||||
return 3
|
||||
print(msg)
|
||||
return 2 if status == fb_status.ALIVE else 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 +79,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.encode('utf-8'), 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 +93,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
|
||||
|
||||
|
|
2
vendor/git.apache.org/thrift.git/contrib/fb303/py/setup.py
generated
vendored
2
vendor/git.apache.org/thrift.git/contrib/fb303/py/setup.py
generated
vendored
|
@ -26,7 +26,7 @@ except:
|
|||
from distutils.core import setup, Extension, Command
|
||||
|
||||
setup(name='thrift_fb303',
|
||||
version='0.10.0',
|
||||
version='0.12.0',
|
||||
description='Python bindings for the Apache Thrift FB303',
|
||||
author=['Thrift Developers'],
|
||||
author_email=['dev@thrift.apache.org'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue