From 035749d384f16352274ccc36388f08838b4ab395 Mon Sep 17 00:00:00 2001 From: sowmyasri Date: Wed, 31 Jul 2024 14:52:50 +0200 Subject: [PATCH] changed the type of the combiner to string --- examples/async-clients/run_clients.py | 2 +- fedn/cli/client_cmd.py | 8 ++++---- fedn/cli/run_cmd.py | 10 ++++++---- fedn/network/clients/connect.py | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/async-clients/run_clients.py b/examples/async-clients/run_clients.py index f2ce72291..68ede960d 100644 --- a/examples/async-clients/run_clients.py +++ b/examples/async-clients/run_clients.py @@ -47,7 +47,7 @@ "secure": False, "preshared_cert": False, "verify": False, - "preferred_combiner": False, + "combiner": "combiner", "validator": True, "trainer": True, "init": None, diff --git a/fedn/cli/client_cmd.py b/fedn/cli/client_cmd.py index 80b0b3353..08d633862 100644 --- a/fedn/cli/client_cmd.py +++ b/fedn/cli/client_cmd.py @@ -79,7 +79,7 @@ def list_clients(ctx, protocol: str, host: str, port: str, token: str = None, n_ @click.option("-s", "--secure", required=False, default=False) @click.option("-pc", "--preshared-cert", required=False, default=False) @click.option("-v", "--verify", is_flag=True, help="Verify SSL/TLS for REST service") -@click.option("-c", "--preferred-combiner", required=False, default=False) +@click.option("-c", "--combiner", type=str,required=False, default="combiner",name="name of the preferred combiner") @click.option("-va", "--validator", required=False, default=True) @click.option("-tr", "--trainer", required=False, default=True) @click.option("-in", "--init", required=False, default=None, help="Set to a filename to (re)init client from file state.") @@ -101,7 +101,7 @@ def client_cmd( secure, preshared_cert, verify, - preferred_combiner, + combiner, validator, trainer, init, @@ -121,7 +121,7 @@ def client_cmd( :param secure: :param preshared_cert: :param verify_cert: - :param preferred_combiner: + :param combiner: :param init: :param logfile: :param hearbeat_interval @@ -142,7 +142,7 @@ def client_cmd( "secure": secure, "preshared_cert": preshared_cert, "verify": verify, - "preferred_combiner": preferred_combiner, + "preferred_combiner": combiner, "validator": validator, "trainer": trainer, "logfile": logfile, diff --git a/fedn/cli/run_cmd.py b/fedn/cli/run_cmd.py index 0aa069046..44daca790 100644 --- a/fedn/cli/run_cmd.py +++ b/fedn/cli/run_cmd.py @@ -182,7 +182,7 @@ def build_cmd(ctx, path): @click.option("-s", "--secure", required=False, default=False) @click.option("-pc", "--preshared-cert", required=False, default=False) @click.option("-v", "--verify", is_flag=True, help="Verify SSL/TLS for REST service") -@click.option("-c", "--preferred-combiner", required=False, default=False) +@click.option("-c", "--combiner", required=False,type=str, default="combiner",help="name of the preferred combiner") @click.option("-va", "--validator", required=False, default=True) @click.option("-tr", "--trainer", required=False, default=True) @click.option("-in", "--init", required=False, default=None, help="Set to a filename to (re)init client from file state.") @@ -204,7 +204,7 @@ def client_cmd( secure, preshared_cert, verify, - preferred_combiner, + combiner, validator, trainer, init, @@ -224,7 +224,7 @@ def client_cmd( :param secure: :param preshared_cert: :param verify_cert: - :param preferred_combiner: + :param combiner: :param init: :param logfile: :param hearbeat_interval @@ -245,7 +245,7 @@ def client_cmd( "secure": secure, "preshared_cert": preshared_cert, "verify": verify, - "preferred_combiner": preferred_combiner, + "preferred_combiner": combiner, "validator": validator, "trainer": trainer, "logfile": logfile, @@ -262,6 +262,7 @@ def client_cmd( apply_config(init, config) click.echo(f"\nClient configuration loaded from file: {init}") click.echo("Values set in file override defaults and command line arguments...\n") + click.echo(f"config {config}") try: validate_client_config(config) @@ -316,6 +317,7 @@ def combiner_cmd(ctx, discoverhost, discoverport, token, name, host, port, fqdn, ) if init: + print(config) apply_config(init, config) click.echo(f"\nCombiner configuration loaded from file: {init}") click.echo("Values set in file override defaults and command line arguments...\n") diff --git a/fedn/network/clients/connect.py b/fedn/network/clients/connect.py index 59aaead35..2b5a10387 100644 --- a/fedn/network/clients/connect.py +++ b/fedn/network/clients/connect.py @@ -38,7 +38,7 @@ class ConnectorClient: :param force_ssl: True if https is used, False if http :type force_ssl: bool :param verify: True if certificate is verified, False if not - :type verify: bool + :type verify: str :param combiner: name of preferred combiner :type combiner: str :param id: id of client