Skip to content

Commit

Permalink
Fix __main__.py for partitioner service.
Browse files Browse the repository at this point in the history
Fixing default arg for SSL dir after recent minor change, and updating
DataServiceClient init to adhere to new design.
  • Loading branch information
robertbartel authored and christophertubbs committed Nov 1, 2023
1 parent b93e593 commit 3e60ea2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .service import ServiceManager
from dmod.scheduler.job import DefaultJobUtilFactory
from dmod.externalrequests.maas_request_handlers import DataServiceClient
from dmod.communication import WebSocketClient
from pathlib import Path
from socket import gethostname

Expand Down Expand Up @@ -38,7 +39,7 @@ def _handle_args():
parser.add_argument('--ssl-dir',
help='Change the base directory when using SSL certificate and key files with default names',
dest='ssl_dir',
default='/ssl/partitionerservice')
default='/ssl/partitioner-service')
parser.add_argument('--cert',
help='Specify path for a particular SSL certificate file to use',
dest='cert_path',
Expand Down Expand Up @@ -154,8 +155,9 @@ def main():
job_util = DefaultJobUtilFactory.factory_create(redis_host=args.redis_host, redis_port=args.redis_port,
redis_pass=redis_pass)

data_service_url = DataServiceClient.build_endpoint_uri(host=args.data_service_host, port=args.data_service_port)
data_client = DataServiceClient(endpoint_uri=data_service_url, ssl_directory=Path(args.data_service_ssl_dir))
data_client = DataServiceClient(transport_client=WebSocketClient(endpoint_host=args.data_service_host,
endpoint_port=args.data_service_port,
capath=args.data_service_ssl_dir))

service = ServiceManager(port=args.listen_port, listen_host=args.listen_host, ssl_dir=Path(args.ssl_dir),
cert_pem=args.cert_path, priv_key_pem=args.key_path, image_name=image, job_util=job_util,
Expand Down

0 comments on commit 3e60ea2

Please sign in to comment.