clan-cli/update: only pass flake-uri/flake-attr if they are set
All checks were successful
build / test (pull_request) Successful in 29s

This commit is contained in:
Jörg Thalheim 2023-08-11 17:27:36 +02:00
parent 51f40a4f09
commit 295591ed79

View File

@ -86,11 +86,12 @@ def deploy_nixos(hosts: HostGroup) -> None:
# FIXME: we want some kind of inventory here.
def update(args: argparse.Namespace) -> None:
deploy_nixos(
HostGroup(
[Host(args.host, user=args.user, meta=dict(flake_attr=args.flake_attr))]
)
)
meta = {}
if args.flake_uri:
meta["flake_uri"] = args.flake_uri
if args.flake_attr:
meta["flake_attr"] = args.flake_attr
deploy_nixos(HostGroup([Host(args.host, user=args.user, meta=meta)]))
def register_parser(parser: argparse.ArgumentParser) -> None: