update!: switch from one comma-sep. argument to variadic args. for hosts
Since the hosts are what nixos-rebuild acts on it makes to have them represented by unlimited variadic arguments similar to how "git add", "cat", "nix build", etc. work.
This commit is contained in:
parent
11a2b74aee
commit
3cdd4ba8b5
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue