diff --git a/src/infra_rebuild/cli/__init__.py b/src/infra_rebuild/cli/__init__.py index fac2d3f..38030ea 100644 --- a/src/infra_rebuild/cli/__init__.py +++ b/src/infra_rebuild/cli/__init__.py @@ -10,42 +10,42 @@ def infra_rebuild(): @infra_rebuild.command() -@click.argument("hosts") +@click.argument("hosts", nargs=-1) def build(hosts): operations.run("build", hosts) @infra_rebuild.command() -@click.argument("hosts") +@click.argument("hosts", nargs=-1) def build_vm(hosts): operations.run("build-vm", hosts) @infra_rebuild.command() -@click.argument("hosts") +@click.argument("hosts", nargs=-1) def build_vm_with_bootloader(hosts): operations.run("build-vm-with-bootloader", hosts) @infra_rebuild.command() -@click.argument("hosts") +@click.argument("hosts", nargs=-1) def switch(hosts): operations.run("switch", hosts) @infra_rebuild.command() -@click.argument("hosts") +@click.argument("hosts", nargs=-1) def boot(hosts): operations.run("boot", hosts) @infra_rebuild.command() -@click.argument("hosts") +@click.argument("hosts", nargs=-1) def test(hosts): operations.run("test", hosts) @infra_rebuild.command() -@click.argument("hosts") +@click.argument("hosts", nargs=-1) def reboot(hosts): operations.run("reboot", hosts) diff --git a/src/infra_rebuild/operations/__init__.py b/src/infra_rebuild/operations/__init__.py index 4a581e0..0ae726e 100644 --- a/src/infra_rebuild/operations/__init__.py +++ b/src/infra_rebuild/operations/__init__.py @@ -23,8 +23,7 @@ def run(operation, hosts): msg.error("Internal Error: The given operation isn't valid.") sys.exit(1) - for host_string in hosts.split(","): - host = host_string.strip() + for host in hosts: if not host: msg.warning("Skipping empty string provided for host.") continue