clan-cli: fix mypy
This commit is contained in:
parent
9906d12384
commit
b34141283f
@ -4,7 +4,7 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
def create(args):
|
def create(args: argparse.Namespace) -> None:
|
||||||
os.makedirs(args.folder, exist_ok=True)
|
os.makedirs(args.folder, exist_ok=True)
|
||||||
# TODO create clan template in flake
|
# TODO create clan template in flake
|
||||||
subprocess.Popen(
|
subprocess.Popen(
|
||||||
@ -18,7 +18,7 @@ def create(args):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def edit(args):
|
def edit(args: argparse.Namespace) -> None:
|
||||||
# TODO add some cli options to change certain options without relying on a text editor
|
# TODO add some cli options to change certain options without relying on a text editor
|
||||||
clan_flake = f"{args.folder}/flake.nix"
|
clan_flake = f"{args.folder}/flake.nix"
|
||||||
if os.path.isfile(clan_flake):
|
if os.path.isfile(clan_flake):
|
||||||
@ -34,7 +34,7 @@ def edit(args):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def rebuild(args):
|
def rebuild(args: argparse.Namespace) -> None:
|
||||||
# TODO get clients from zerotier cli?
|
# TODO get clients from zerotier cli?
|
||||||
if args.host:
|
if args.host:
|
||||||
print(f"would redeploy {args.host} from clan {args.folder}")
|
print(f"would redeploy {args.host} from clan {args.folder}")
|
||||||
@ -42,7 +42,7 @@ def rebuild(args):
|
|||||||
print(f"would redeploy all hosts from clan {args.folder}")
|
print(f"would redeploy all hosts from clan {args.folder}")
|
||||||
|
|
||||||
|
|
||||||
def destroy(args):
|
def destroy(args: argparse.Namespace) -> None:
|
||||||
# TODO get clan folder & hosts from somwhere (maybe ~/.config/clan/$name /)
|
# TODO get clan folder & hosts from somwhere (maybe ~/.config/clan/$name /)
|
||||||
# send some kind of kill signal, then remove the folder
|
# send some kind of kill signal, then remove the folder
|
||||||
if args.yes:
|
if args.yes:
|
||||||
@ -53,14 +53,14 @@ def destroy(args):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def backup(args):
|
def backup(args: argparse.Namespace) -> None:
|
||||||
if args.host:
|
if args.host:
|
||||||
print(f"would backup {args.host} from clan {args.folder}")
|
print(f"would backup {args.host} from clan {args.folder}")
|
||||||
else:
|
else:
|
||||||
print(f"would backup all hosts from clan {args.folder}")
|
print(f"would backup all hosts from clan {args.folder}")
|
||||||
|
|
||||||
|
|
||||||
def git(args):
|
def git(args: argparse.Namespace) -> None:
|
||||||
subprocess.Popen(
|
subprocess.Popen(
|
||||||
[
|
[
|
||||||
"git",
|
"git",
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# !/usr/bin/env python3
|
# !/usr/bin/env python3
|
||||||
import sys
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def showhelp():
|
def showhelp() -> None:
|
||||||
print('''
|
print('''
|
||||||
usage:
|
usage:
|
||||||
clan admin ...
|
clan admin ...
|
||||||
|
Loading…
Reference in New Issue
Block a user