From 2c6899fa2a5d2ba736b78a55d263091f6695ee49 Mon Sep 17 00:00:00 2001 From: David Shrewsbury Date: Wed, 26 Jun 2013 16:21:27 -0400 Subject: [PATCH] [WORKER] Use consistent Gearman SSL option names Makes the names of the Gearman SSL options consistent with statsd and API server. Change-Id: Iba8542e192da365b78c1e8a4bfa3a49f459b9c92 --- doc/worker/config.rst | 32 ++++++++++++++++---------------- libra/worker/main.py | 24 ++++++++++++------------ libra/worker/worker.py | 8 ++++---- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/doc/worker/config.rst b/doc/worker/config.rst index 59f7b4c4..57e2a99e 100644 --- a/doc/worker/config.rst +++ b/doc/worker/config.rst @@ -28,6 +28,22 @@ Command Line Options * *haproxy* - `HAProxy `_ software load balancer. This is the default driver. + .. option:: --gearman_ssl_ca + + Full path to the file with the CA public key to use when + connecting to an SSL-enabled Gearman job server. This is used + to validate the server key. + + .. option:: --gearman_ssl_cert + + Full path to the file with the SSL public key to use when + connecting to an SSL-enabled Gearman job server. + + .. option:: --gearman_ssl_key + + Full path to the file with the SSL private key to use when + connecting to an SSL-enabled Gearman job server. + .. option:: -s , --reconnect_sleep The number of seconds to sleep between job server reconnect attempts @@ -38,22 +54,6 @@ Command Line Options Used to specify the Gearman job server hostname and port. This option can be used multiple times to specify multiple job servers. - .. option:: --ssl_keyfile - - Full path to the file with the SSL private key to use when - connecting to an SSL-enabled Gearman job server. - - .. option:: --ssl_certfile - - Full path to the file with the SSL public key to use when - connecting to an SSL-enabled Gearman job server. - - .. option:: --ssl_ca_certs - - Full path to the file with the CA public key to use when - connecting to an SSL-enabled Gearman job server. This is used - to validate the server key. - .. option:: --stats-poll The number of seconds to sleep between statistics polling of the diff --git a/libra/worker/main.py b/libra/worker/main.py index 479ff483..dc9848e9 100644 --- a/libra/worker/main.py +++ b/libra/worker/main.py @@ -70,6 +70,18 @@ def main(): choices=known_drivers.keys(), default='haproxy', help='type of device to use' ) + options.parser.add_argument( + '--gearman_ssl_ca', dest='gearman_ssl_ca', metavar='FILE', + help='Gearman SSL certificate authority' + ) + options.parser.add_argument( + '--gearman_ssl_cert', dest='gearman_ssl_cert', metavar='FILE', + help='Gearman SSL certificate' + ) + options.parser.add_argument( + '--gearman_ssl_key', dest='gearman_ssl_key', metavar='FILE', + help='Gearman SSL key' + ) options.parser.add_argument( '--haproxy-service', dest='haproxy_service', choices=haproxy_services.keys(), default='ubuntu', @@ -85,18 +97,6 @@ def main(): default=[], help='add a Gearman job server to the connection list' ) - options.parser.add_argument( - '--ssl_ca_certs', dest='ssl_ca_certs', metavar='FILE', - help='path to file with CA public cert(s)' - ) - options.parser.add_argument( - '--ssl_certfile', dest='ssl_certfile', metavar='FILE', - help='path to file with public key' - ) - options.parser.add_argument( - '--ssl_keyfile', dest='ssl_keyfile', metavar='FILE', - help='path to file with private key' - ) options.parser.add_argument( '--stats-poll', dest='stats_poll', type=int, metavar='TIME', default=300, help='statistics polling interval in seconds' diff --git a/libra/worker/worker.py b/libra/worker/worker.py index 9f7e2284..d6c3af72 100644 --- a/libra/worker/worker.py +++ b/libra/worker/worker.py @@ -63,15 +63,15 @@ def config_thread(logger, driver, args): hostname = socket.gethostname() logger.info("[worker] Registering task %s" % hostname) - if all([args.ssl_keyfile, args.ssl_certfile, args.ssl_ca_certs]): + if all([args.gearman_ssl_key, args.gearman_ssl_cert, args.gearman_ssl_ca]): ssl_server_list = [] for host_port in args.server: host, port = host_port.split(':') ssl_server_list.append({'host': host, 'port': port, - 'keyfile': args.ssl_keyfile, - 'certfile': args.ssl_certfile, - 'ca_certs': args.ssl_ca_certs}) + 'keyfile': args.gearman_ssl_key, + 'certfile': args.gearman_ssl_cert, + 'ca_certs': args.gearman_ssl_ca}) worker = CustomJSONGearmanWorker(ssl_server_list) else: worker = CustomJSONGearmanWorker(args.server)