Merge pull request 'don't register global logger, this interferes currently with that we have in ssh.py' (#392) from Mic92-kvm-fix into main
This commit is contained in:
7
flake.lock
generated
7
flake.lock
generated
@@ -7,16 +7,15 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1695379860,
|
||||
"narHash": "sha256-ADsWLw33T/6APAoEfwPVkhuUHbH/BW/Jz5cgTgijsIs=",
|
||||
"lastModified": 1696266752,
|
||||
"narHash": "sha256-wJnMDFM21+xXdsXSs6pXMElbv4YfqmQslcPApRuaYKs=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "26cf7576b85fd0b4070d8bd84475021e01d63814",
|
||||
"rev": "646ee25c25fffee122a66282861f5f56ad3e0fd9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "party",
|
||||
"repo": "disko",
|
||||
"type": "github"
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
{
|
||||
description = "clan.lol base operating system";
|
||||
|
||||
nixConfig.extra-substituters = [ "https://cache.clan.lol" ];
|
||||
nixConfig.extra-trusted-public-keys = [ "cache.clan.lol-1:3KztgSAB5R1M+Dz7vzkBGzXdodizbgLXGXKXlcQLA28=" ];
|
||||
|
||||
inputs = {
|
||||
#nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
# https://github.com/NixOS/nixpkgs/pull/257462
|
||||
nixpkgs.url = "github:Mic92/nixpkgs/fakeroot";
|
||||
floco.url = "github:aakropotkin/floco";
|
||||
floco.inputs.nixpkgs.follows = "nixpkgs";
|
||||
disko.url = "github:nix-community/disko/party";
|
||||
disko.url = "github:nix-community/disko";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
sops-nix.inputs.nixpkgs.follows = "sops-nix";
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
import argparse
|
||||
import logging
|
||||
import sys
|
||||
from types import ModuleType
|
||||
from typing import Optional
|
||||
|
||||
from . import config, create, custom_logger, machines, secrets, vms, webui
|
||||
from . import config, create, machines, secrets, vms, webui
|
||||
from .errors import ClanError
|
||||
from .ssh import cli as ssh_cli
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
argcomplete: Optional[ModuleType] = None
|
||||
try:
|
||||
import argcomplete # type: ignore[no-redef]
|
||||
@@ -66,19 +63,12 @@ def main() -> None:
|
||||
parser = create_parser()
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.debug:
|
||||
custom_logger.register(logging.DEBUG)
|
||||
log.debug("Debug logging enabled")
|
||||
else:
|
||||
custom_logger.register(logging.INFO)
|
||||
|
||||
if not hasattr(args, "func"):
|
||||
log.error("No argparse function registered")
|
||||
return
|
||||
try:
|
||||
args.func(args)
|
||||
except ClanError as e:
|
||||
log.exception(e)
|
||||
print(e, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user