[WORKER] Use consistent Gearman SSL option names
Makes the names of the Gearman SSL options consistent with statsd and API server. Change-Id: Iba8542e192da365b78c1e8a4bfa3a49f459b9c92
This commit is contained in:
@@ -28,6 +28,22 @@ Command Line Options
|
|||||||
* *haproxy* - `HAProxy <http://haproxy.1wt.eu>`_ software load balancer.
|
* *haproxy* - `HAProxy <http://haproxy.1wt.eu>`_ software load balancer.
|
||||||
This is the default driver.
|
This is the default driver.
|
||||||
|
|
||||||
|
.. option:: --gearman_ssl_ca <FILE>
|
||||||
|
|
||||||
|
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 <FILE>
|
||||||
|
|
||||||
|
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 <FILE>
|
||||||
|
|
||||||
|
Full path to the file with the SSL private key to use when
|
||||||
|
connecting to an SSL-enabled Gearman job server.
|
||||||
|
|
||||||
.. option:: -s <SECONDS>, --reconnect_sleep <SECONDS>
|
.. option:: -s <SECONDS>, --reconnect_sleep <SECONDS>
|
||||||
|
|
||||||
The number of seconds to sleep between job server reconnect attempts
|
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
|
Used to specify the Gearman job server hostname and port. This option
|
||||||
can be used multiple times to specify multiple job servers.
|
can be used multiple times to specify multiple job servers.
|
||||||
|
|
||||||
.. option:: --ssl_keyfile <FILE>
|
|
||||||
|
|
||||||
Full path to the file with the SSL private key to use when
|
|
||||||
connecting to an SSL-enabled Gearman job server.
|
|
||||||
|
|
||||||
.. option:: --ssl_certfile <FILE>
|
|
||||||
|
|
||||||
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 <FILE>
|
|
||||||
|
|
||||||
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 <SECONDS>
|
.. option:: --stats-poll <SECONDS>
|
||||||
|
|
||||||
The number of seconds to sleep between statistics polling of the
|
The number of seconds to sleep between statistics polling of the
|
||||||
|
|||||||
@@ -70,6 +70,18 @@ def main():
|
|||||||
choices=known_drivers.keys(), default='haproxy',
|
choices=known_drivers.keys(), default='haproxy',
|
||||||
help='type of device to use'
|
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(
|
options.parser.add_argument(
|
||||||
'--haproxy-service', dest='haproxy_service',
|
'--haproxy-service', dest='haproxy_service',
|
||||||
choices=haproxy_services.keys(), default='ubuntu',
|
choices=haproxy_services.keys(), default='ubuntu',
|
||||||
@@ -85,18 +97,6 @@ def main():
|
|||||||
default=[],
|
default=[],
|
||||||
help='add a Gearman job server to the connection list'
|
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(
|
options.parser.add_argument(
|
||||||
'--stats-poll', dest='stats_poll', type=int, metavar='TIME',
|
'--stats-poll', dest='stats_poll', type=int, metavar='TIME',
|
||||||
default=300, help='statistics polling interval in seconds'
|
default=300, help='statistics polling interval in seconds'
|
||||||
|
|||||||
@@ -63,15 +63,15 @@ def config_thread(logger, driver, args):
|
|||||||
hostname = socket.gethostname()
|
hostname = socket.gethostname()
|
||||||
logger.info("[worker] Registering task %s" % hostname)
|
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 = []
|
ssl_server_list = []
|
||||||
for host_port in args.server:
|
for host_port in args.server:
|
||||||
host, port = host_port.split(':')
|
host, port = host_port.split(':')
|
||||||
ssl_server_list.append({'host': host,
|
ssl_server_list.append({'host': host,
|
||||||
'port': port,
|
'port': port,
|
||||||
'keyfile': args.ssl_keyfile,
|
'keyfile': args.gearman_ssl_key,
|
||||||
'certfile': args.ssl_certfile,
|
'certfile': args.gearman_ssl_cert,
|
||||||
'ca_certs': args.ssl_ca_certs})
|
'ca_certs': args.gearman_ssl_ca})
|
||||||
worker = CustomJSONGearmanWorker(ssl_server_list)
|
worker = CustomJSONGearmanWorker(ssl_server_list)
|
||||||
else:
|
else:
|
||||||
worker = CustomJSONGearmanWorker(args.server)
|
worker = CustomJSONGearmanWorker(args.server)
|
||||||
|
|||||||
Reference in New Issue
Block a user