Merge pull request 'refactor: move clan_cli.error to clan_lib.error' (#3677) from hsjobeki/clan-core:chores-1 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3677
This commit is contained in:
@@ -29,13 +29,13 @@ from dataclasses import dataclass, field
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_lib.api.modules import (
|
from clan_lib.api.modules import (
|
||||||
CategoryInfo,
|
CategoryInfo,
|
||||||
Frontmatter,
|
Frontmatter,
|
||||||
extract_frontmatter,
|
extract_frontmatter,
|
||||||
get_roles,
|
get_roles,
|
||||||
)
|
)
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
# Get environment variables
|
# Get environment variables
|
||||||
CLAN_CORE_PATH = Path(os.environ["CLAN_CORE_PATH"])
|
CLAN_CORE_PATH = Path(os.environ["CLAN_CORE_PATH"])
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ rg "import pytest"
|
|||||||
If any python test fails in the CI pipeline, an error message like this can be found at the end of the log:
|
If any python test fails in the CI pipeline, an error message like this can be found at the end of the log:
|
||||||
```
|
```
|
||||||
...
|
...
|
||||||
FAILED tests/test_machines_cli.py::test_machine_delete - clan_cli.errors.ClanError: Template 'new-machine' not in 'inputs.clan-core
|
FAILED tests/test_machines_cli.py::test_machine_delete - clan_lib.errors.ClanError: Template 'new-machine' not in 'inputs.clan-core
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import os
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
# Get environment variables
|
# Get environment variables
|
||||||
INVENTORY_SCHEMA_PATH = Path(os.environ["INVENTORY_SCHEMA_PATH"])
|
INVENTORY_SCHEMA_PATH = Path(os.environ["INVENTORY_SCHEMA_PATH"])
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ from .clan import show, update
|
|||||||
# API endpoints that are not used in the cli.
|
# API endpoints that are not used in the cli.
|
||||||
__all__ = ["directory", "disk", "mdns_discovery", "modules", "update"]
|
__all__ = ["directory", "disk", "mdns_discovery", "modules", "update"]
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from . import (
|
from . import (
|
||||||
@@ -26,7 +27,6 @@ from . import (
|
|||||||
)
|
)
|
||||||
from .custom_logger import setup_logging
|
from .custom_logger import setup_logging
|
||||||
from .dirs import get_clan_flake_toplevel_or_env
|
from .dirs import get_clan_flake_toplevel_or_env
|
||||||
from .errors import ClanError
|
|
||||||
from .facts import cli as facts
|
from .facts import cli as facts
|
||||||
from .flash import cli as flash_cli
|
from .flash import cli as flash_cli
|
||||||
from .hyperlink import help_hyperlink
|
from .hyperlink import help_hyperlink
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from collections.abc import Callable
|
|||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import IO, Any, Generic, ParamSpec, TypeVar
|
from typing import IO, Any, Generic, ParamSpec, TypeVar
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
complete_backup_providers_for_machine,
|
complete_backup_providers_for_machine,
|
||||||
complete_machines,
|
complete_machines,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ import argparse
|
|||||||
import json
|
import json
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import Log, RunOpts
|
from clan_cli.cmd import Log, RunOpts
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
complete_backup_providers_for_machine,
|
complete_backup_providers_for_machine,
|
||||||
complete_machines,
|
complete_machines,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.ssh.host import Host
|
from clan_cli.ssh.host import Host
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import Log, RunOpts
|
from clan_cli.cmd import Log, RunOpts
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
complete_backup_providers_for_machine,
|
complete_backup_providers_for_machine,
|
||||||
complete_machines,
|
complete_machines,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.ssh.host import Host
|
from clan_cli.ssh.host import Host
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ from dataclasses import dataclass
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
from clan_lib.nix_models.inventory import Inventory
|
from clan_lib.nix_models.inventory import Inventory
|
||||||
from clan_lib.persist.inventory_store import InventoryStore
|
from clan_lib.persist.inventory_store import InventoryStore
|
||||||
|
|
||||||
from clan_cli.cmd import CmdOut, RunOpts, run
|
from clan_cli.cmd import CmdOut, RunOpts, run
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.nix import nix_command, nix_metadata, nix_shell
|
from clan_cli.nix import nix_command, nix_metadata, nix_shell
|
||||||
from clan_cli.templates import (
|
from clan_cli.templates import (
|
||||||
InputPrio,
|
InputPrio,
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ from dataclasses import dataclass
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from clan_cli.cmd import run
|
from clan_cli.cmd import run
|
||||||
from clan_cli.dirs import machine_gcroot
|
from clan_cli.dirs import machine_gcroot
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.list import list_machines
|
from clan_cli.machines.list import list_machines
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.nix import (
|
from clan_cli.nix import (
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ from pathlib import Path
|
|||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanCmdError, ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
from clan_lib.nix_models.inventory import Meta
|
from clan_lib.nix_models.inventory import Meta
|
||||||
|
|
||||||
from clan_cli.cmd import run
|
from clan_cli.cmd import run
|
||||||
from clan_cli.errors import ClanCmdError, ClanError
|
|
||||||
from clan_cli.nix import nix_eval
|
from clan_cli.nix import nix_eval
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -18,10 +18,11 @@ from enum import Enum
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import IO, Any
|
from typing import IO, Any
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanCmdError, ClanError, CmdOut, indent_command
|
||||||
|
|
||||||
from clan_cli.async_run import get_async_ctx, is_async_cancelled
|
from clan_cli.async_run import get_async_ctx, is_async_cancelled
|
||||||
from clan_cli.colors import Color
|
from clan_cli.colors import Color
|
||||||
from clan_cli.custom_logger import print_trace
|
from clan_cli.custom_logger import print_trace
|
||||||
from clan_cli.errors import ClanCmdError, ClanError, CmdOut, indent_command
|
|
||||||
|
|
||||||
cmdlog = logging.getLogger(__name__)
|
cmdlog = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,8 @@ def complete_secrets(
|
|||||||
"""
|
"""
|
||||||
Provides completion functionality for clan secrets
|
Provides completion functionality for clan secrets
|
||||||
"""
|
"""
|
||||||
from . import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from .secrets.secrets import list_secrets
|
from .secrets.secrets import list_secrets
|
||||||
|
|
||||||
flake = clan_dir_result if (clan_dir_result := clan_dir(None)) is not None else "."
|
flake = clan_dir_result if (clan_dir_result := clan_dir(None)) is not None else "."
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from enum import Enum
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|||||||
@@ -7,13 +7,14 @@ from collections.abc import Callable
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import RunOpts, run
|
from clan_cli.cmd import RunOpts, run
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
complete_machines,
|
complete_machines,
|
||||||
complete_services_for_machine,
|
complete_services_for_machine,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.git import commit_files
|
from clan_cli.git import commit_files
|
||||||
from clan_cli.machines.list import list_machines
|
from clan_cli.machines.list import list_machines
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
|
|
||||||
from . import FactStoreBase
|
from . import FactStoreBase
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.dirs import vm_state_dir
|
from clan_cli.dirs import vm_state_dir
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
|
|
||||||
from . import FactStoreBase
|
from . import FactStoreBase
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ from collections.abc import Generator
|
|||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import Log, RunOpts, run
|
from clan_cli.cmd import Log, RunOpts, run
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ from tempfile import TemporaryDirectory
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import Log, RunOpts, cmd_with_root, run
|
from clan_cli.cmd import Log, RunOpts, cmd_with_root, run
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.facts.generate import generate_facts
|
from clan_cli.facts.generate import generate_facts
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.nix import nix_shell
|
from clan_cli.nix import nix_shell
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import os
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import Log, RunOpts, run
|
from clan_cli.cmd import Log, RunOpts, run
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.nix import nix_build
|
from clan_cli.nix import nix_build
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from .cmd import Log, RunOpts, run
|
from .cmd import Log, RunOpts, run
|
||||||
from .errors import ClanError
|
|
||||||
from .locked_open import locked_open
|
from .locked_open import locked_open
|
||||||
from .nix import nix_shell
|
from .nix import nix_shell
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ from pathlib import Path
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
from clan_lib.nix_models.inventory import Inventory
|
from clan_lib.nix_models.inventory import Inventory
|
||||||
from clan_lib.persist.inventory_store import WriteInfo
|
from clan_lib.persist.inventory_store import WriteInfo
|
||||||
@@ -26,7 +27,6 @@ from clan_lib.persist.util import (
|
|||||||
determine_writeability,
|
determine_writeability,
|
||||||
)
|
)
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.git import commit_file
|
from clan_cli.git import commit_file
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ from dataclasses import dataclass
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
from clan_lib.nix_models.inventory import (
|
from clan_lib.nix_models.inventory import (
|
||||||
Machine as InventoryMachine,
|
Machine as InventoryMachine,
|
||||||
@@ -17,7 +18,6 @@ from clan_lib.persist.util import apply_patch
|
|||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_tags
|
from clan_cli.completions import add_dynamic_completer, complete_tags
|
||||||
from clan_cli.dirs import get_clan_flake_toplevel_or_env
|
from clan_cli.dirs import get_clan_flake_toplevel_or_env
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.git import commit_file
|
from clan_cli.git import commit_file
|
||||||
from clan_cli.machines.list import list_machines
|
from clan_cli.machines.list import list_machines
|
||||||
from clan_cli.templates import (
|
from clan_cli.templates import (
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ from enum import Enum
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanCmdError, ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import RunOpts, run
|
from clan_cli.cmd import RunOpts, run
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.dirs import specific_machine_dir
|
from clan_cli.dirs import specific_machine_dir
|
||||||
from clan_cli.errors import ClanCmdError, ClanError
|
|
||||||
from clan_cli.git import commit_file
|
from clan_cli.git import commit_file
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.nix import nix_config, nix_eval
|
from clan_cli.nix import nix_config, nix_eval
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from pathlib import Path
|
|||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import Log, RunOpts, run
|
from clan_cli.cmd import Log, RunOpts, run
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
@@ -15,7 +16,6 @@ from clan_cli.completions import (
|
|||||||
complete_machines,
|
complete_machines,
|
||||||
complete_target_host,
|
complete_target_host,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.facts.generate import generate_facts
|
from clan_cli.facts.generate import generate_facts
|
||||||
from clan_cli.machines.hardware import HardwareConfig
|
from clan_cli.machines.hardware import HardwareConfig
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.nix_models.inventory import (
|
from clan_lib.nix_models.inventory import (
|
||||||
Machine as InventoryMachine,
|
Machine as InventoryMachine,
|
||||||
)
|
)
|
||||||
from clan_lib.persist.inventory_store import InventoryStore
|
from clan_lib.persist.inventory_store import InventoryStore
|
||||||
from clan_lib.persist.util import apply_patch
|
from clan_lib.persist.util import apply_patch
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ from functools import cached_property
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanCmdError, ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from clan_cli.cmd import Log, RunOpts, run
|
from clan_cli.cmd import Log, RunOpts, run
|
||||||
from clan_cli.errors import ClanCmdError, ClanError
|
|
||||||
from clan_cli.facts import public_modules as facts_public_modules
|
from clan_cli.facts import public_modules as facts_public_modules
|
||||||
from clan_cli.facts import secret_modules as facts_secret_modules
|
from clan_cli.facts import secret_modules as facts_secret_modules
|
||||||
from clan_cli.nix import nix_config, nix_eval, nix_test_store
|
from clan_cli.nix import nix_config, nix_eval, nix_test_store
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import re
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
from clan_lib.nix_models.inventory import Machine as InventoryMachine
|
from clan_lib.nix_models.inventory import Machine as InventoryMachine
|
||||||
|
|
||||||
from clan_cli.cmd import Log, RunOpts, run
|
from clan_cli.cmd import Log, RunOpts, run
|
||||||
from clan_cli.dirs import get_clan_flake_toplevel_or_env
|
from clan_cli.dirs import get_clan_flake_toplevel_or_env
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.create import CreateOptions, create_machine
|
from clan_cli.machines.create import CreateOptions, create_machine
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.nix import nix_build, nix_command
|
from clan_cli.nix import nix_build, nix_command
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import sys
|
|||||||
from contextlib import ExitStack
|
from contextlib import ExitStack
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.async_run import AsyncContext, AsyncOpts, AsyncRuntime, is_async_cancelled
|
from clan_cli.async_run import AsyncContext, AsyncOpts, AsyncRuntime, is_async_cancelled
|
||||||
from clan_cli.cmd import Log, MsgColor, RunOpts, run
|
from clan_cli.cmd import Log, MsgColor, RunOpts, run
|
||||||
@@ -16,7 +17,6 @@ from clan_cli.completions import (
|
|||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
complete_machines,
|
complete_machines,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.facts.generate import generate_facts
|
from clan_cli.facts.generate import generate_facts
|
||||||
from clan_cli.facts.upload import upload_secrets
|
from clan_cli.facts.upload import upload_secrets
|
||||||
from clan_cli.machines.list import list_machines
|
from clan_cli.machines.list import list_machines
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ from functools import cache
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import run
|
from clan_cli.cmd import run
|
||||||
from clan_cli.dirs import nixpkgs_flake, nixpkgs_source
|
from clan_cli.dirs import nixpkgs_flake, nixpkgs_source
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.locked_open import locked_open
|
from clan_cli.locked_open import locked_open
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import time
|
|||||||
import types
|
import types
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.qemu.qmp import QEMUMonitorProtocol
|
from clan_cli.qemu.qmp import QEMUMonitorProtocol
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import socket
|
|||||||
import types
|
import types
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
|
|
||||||
class QMPError(Exception):
|
class QMPError(Exception):
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import shutil
|
|||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
|
|
||||||
def get_sops_folder(flake_dir: Path) -> Path:
|
def get_sops_folder(flake_dir: Path) -> Path:
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import os
|
|||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
complete_groups,
|
complete_groups,
|
||||||
@@ -10,7 +12,6 @@ from clan_cli.completions import (
|
|||||||
complete_secrets,
|
complete_secrets,
|
||||||
complete_users,
|
complete_users,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.git import commit_files
|
from clan_cli.git import commit_files
|
||||||
from clan_cli.machines.types import machine_name_type, validate_hostname
|
from clan_cli.machines.types import machine_name_type, validate_hostname
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import json
|
|||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import RunOpts, run
|
from clan_cli.cmd import RunOpts, run
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
@@ -10,7 +12,6 @@ from clan_cli.completions import (
|
|||||||
complete_machines,
|
complete_machines,
|
||||||
complete_users,
|
complete_users,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.nix import nix_shell
|
from clan_cli.nix import nix_shell
|
||||||
|
|
||||||
from .secrets import encrypt_secret, sops_secrets_folder
|
from .secrets import encrypt_secret, sops_secrets_folder
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.git import commit_files
|
from clan_cli.git import commit_files
|
||||||
|
|
||||||
from . import sops
|
from . import sops
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import argparse
|
import argparse
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
complete_machines,
|
complete_machines,
|
||||||
complete_secrets,
|
complete_secrets,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.git import commit_files
|
from clan_cli.git import commit_files
|
||||||
from clan_cli.machines.types import machine_name_type, validate_hostname
|
from clan_cli.machines.types import machine_name_type, validate_hostname
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ from collections.abc import Callable
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import IO
|
from typing import IO
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
complete_groups,
|
complete_groups,
|
||||||
@@ -16,7 +18,6 @@ from clan_cli.completions import (
|
|||||||
complete_secrets,
|
complete_secrets,
|
||||||
complete_users,
|
complete_users,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.git import commit_files
|
from clan_cli.git import commit_files
|
||||||
|
|
||||||
from . import sops
|
from . import sops
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ from tempfile import NamedTemporaryFile
|
|||||||
from typing import IO, Any
|
from typing import IO, Any
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from clan_cli.cmd import Log, RunOpts, run
|
from clan_cli.cmd import Log, RunOpts, run
|
||||||
from clan_cli.dirs import user_config_dir
|
from clan_cli.dirs import user_config_dir
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.nix import nix_shell
|
from clan_cli.nix import nix_shell
|
||||||
|
|
||||||
from .folders import sops_users_folder
|
from .folders import sops_users_folder
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import re
|
|||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from .sops import get_public_age_keys
|
from .sops import get_public_age_keys
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ import sys
|
|||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_secrets, complete_users
|
from clan_cli.completions import add_dynamic_completer, complete_secrets, complete_users
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.git import commit_files
|
from clan_cli.git import commit_files
|
||||||
|
|
||||||
from . import groups, secrets, sops
|
from . import groups, secrets, sops
|
||||||
|
|||||||
@@ -6,13 +6,14 @@ from dataclasses import dataclass
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.async_run import AsyncRuntime
|
from clan_cli.async_run import AsyncRuntime
|
||||||
from clan_cli.cmd import run
|
from clan_cli.cmd import run
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
complete_machines,
|
complete_machines,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.nix import nix_shell
|
from clan_cli.nix import nix_shell
|
||||||
from clan_cli.ssh.host import Host, is_ssh_reachable
|
from clan_cli.ssh.host import Host, is_ssh_reachable
|
||||||
|
|||||||
@@ -13,9 +13,10 @@ from shlex import quote
|
|||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import CmdOut, RunOpts, run
|
from clan_cli.cmd import CmdOut, RunOpts, run
|
||||||
from clan_cli.colors import AnsiColor
|
from clan_cli.colors import AnsiColor
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.nix import nix_shell
|
from clan_cli.nix import nix_shell
|
||||||
from clan_cli.ssh.host_key import HostKeyCheck
|
from clan_cli.ssh.host_key import HostKeyCheck
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
|
|
||||||
class HostKeyCheck(Enum):
|
class HostKeyCheck(Enum):
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import urllib.parse
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.ssh.host import Host
|
from clan_cli.ssh.host import Host
|
||||||
from clan_cli.ssh.host_key import HostKeyCheck
|
from clan_cli.ssh.host_key import HostKeyCheck
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Generic
|
from typing import Generic
|
||||||
|
|
||||||
from clan_cli.errors import CmdOut
|
from clan_lib.errors import CmdOut
|
||||||
|
|
||||||
from clan_cli.ssh import T
|
from clan_cli.ssh import T
|
||||||
from clan_cli.ssh.host import Host
|
from clan_cli.ssh.host import Host
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ import struct
|
|||||||
import time
|
import time
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
from clan_lib.errors import TorConnectionError, TorSocksError
|
||||||
|
|
||||||
from clan_cli.async_run import AsyncRuntime
|
from clan_cli.async_run import AsyncRuntime
|
||||||
from clan_cli.cmd import Log, RunOpts, run
|
from clan_cli.cmd import Log, RunOpts, run
|
||||||
from clan_cli.errors import TorConnectionError, TorSocksError
|
|
||||||
from clan_cli.nix import nix_shell
|
from clan_cli.nix import nix_shell
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ from pathlib import Path
|
|||||||
from shlex import quote
|
from shlex import quote
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import Log, RunOpts
|
from clan_cli.cmd import Log, RunOpts
|
||||||
from clan_cli.cmd import run as run_local
|
from clan_cli.cmd import run as run_local
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.ssh.host import Host
|
from clan_cli.ssh.host import Host
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanCmdError, ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import RunOpts, run
|
from clan_cli.cmd import RunOpts, run
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
@@ -10,7 +12,6 @@ from clan_cli.completions import (
|
|||||||
complete_state_services_for_machine,
|
complete_state_services_for_machine,
|
||||||
)
|
)
|
||||||
from clan_cli.dirs import get_clan_flake_toplevel_or_env
|
from clan_cli.dirs import get_clan_flake_toplevel_or_env
|
||||||
from clan_cli.errors import ClanCmdError, ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.nix import nix_eval
|
from clan_cli.nix import nix_eval
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ from dataclasses import dataclass, field
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Literal, NewType, TypedDict, cast
|
from typing import Any, Literal, NewType, TypedDict, cast
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanCmdError, ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from clan_cli.cmd import run
|
from clan_cli.cmd import run
|
||||||
from clan_cli.dirs import clan_templates
|
from clan_cli.dirs import clan_templates
|
||||||
from clan_cli.errors import ClanCmdError, ClanError
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import sys
|
|||||||
from dataclasses import is_dataclass
|
from dataclasses import is_dataclass
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
from clan_lib.api.util import JSchemaTypeError, type_to_dict
|
from clan_lib.api.util import JSchemaTypeError, type_to_dict
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
|
|
||||||
def should_skip(file_path: Path, excludes: list[Path]) -> bool:
|
def should_skip(file_path: Path, excludes: list[Path]) -> bool:
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ from pathlib import Path
|
|||||||
from typing import Any, Literal
|
from typing import Any, Literal
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines import machines
|
from clan_cli.machines import machines
|
||||||
|
|
||||||
# Functions to test
|
# Functions to test
|
||||||
from clan_lib.api import dataclass_to_dict, from_dict
|
from clan_lib.api import dataclass_to_dict, from_dict
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
|
|
||||||
def test_simple() -> None:
|
def test_simple() -> None:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from clan_cli import git
|
from clan_cli import git
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
|
|
||||||
def test_commit_file(git_repo: Path) -> None:
|
def test_commit_file(git_repo: Path) -> None:
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ from contextlib import contextmanager
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.tests.age_keys import assert_secrets_file_recipients
|
from clan_cli.tests.age_keys import assert_secrets_file_recipients
|
||||||
from clan_cli.tests.fixtures_flakes import FlakeForTest
|
from clan_cli.tests.fixtures_flakes import FlakeForTest
|
||||||
from clan_cli.tests.gpg_keys import GpgKey
|
from clan_cli.tests.gpg_keys import GpgKey
|
||||||
from clan_cli.tests.helpers import cli
|
from clan_cli.tests.helpers import cli
|
||||||
from clan_cli.tests.stdout import CaptureOutput
|
from clan_cli.tests.stdout import CaptureOutput
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .age_keys import KeyPair
|
from .age_keys import KeyPair
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ from typing import Any, NamedTuple
|
|||||||
import pytest
|
import pytest
|
||||||
from clan_cli.async_run import AsyncRuntime
|
from clan_cli.async_run import AsyncRuntime
|
||||||
from clan_cli.cmd import ClanCmdTimeoutError, Log, RunOpts
|
from clan_cli.cmd import ClanCmdTimeoutError, Log, RunOpts
|
||||||
from clan_cli.errors import ClanError, CmdOut
|
|
||||||
from clan_cli.ssh.host import Host
|
from clan_cli.ssh.host import Host
|
||||||
from clan_cli.ssh.host_key import HostKeyCheck
|
from clan_cli.ssh.host_key import HostKeyCheck
|
||||||
from clan_cli.ssh.parse import parse_deployment_address
|
from clan_cli.ssh.parse import parse_deployment_address
|
||||||
|
from clan_lib.errors import ClanError, CmdOut
|
||||||
|
|
||||||
if sys.platform == "darwin":
|
if sys.platform == "darwin":
|
||||||
pytest.skip("preload doesn't work on darwin", allow_module_level=True)
|
pytest.skip("preload doesn't work on darwin", allow_module_level=True)
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import shutil
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.nix import nix_eval, run
|
from clan_cli.nix import nix_eval, run
|
||||||
from clan_cli.tests.age_keys import SopsSetup
|
from clan_cli.tests.age_keys import SopsSetup
|
||||||
@@ -23,6 +22,7 @@ from clan_cli.vars.list import stringify_all_vars
|
|||||||
from clan_cli.vars.public_modules import in_repo
|
from clan_cli.vars.public_modules import in_repo
|
||||||
from clan_cli.vars.secret_modules import password_store, sops
|
from clan_cli.vars.secret_modules import password_store, sops
|
||||||
from clan_cli.vars.set import set_var
|
from clan_cli.vars.set import set_var
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ from dataclasses import dataclass
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines import machines
|
from clan_cli.machines import machines
|
||||||
from clan_cli.ssh.host import Host
|
from clan_cli.ssh.host import Host
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .generate import Generator, Var
|
from .generate import Generator, Var
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import argparse
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import argparse
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ from clan_cli.completions import (
|
|||||||
complete_machines,
|
complete_machines,
|
||||||
complete_services_for_machine,
|
complete_services_for_machine,
|
||||||
)
|
)
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.git import commit_files
|
from clan_cli.git import commit_files
|
||||||
from clan_cli.machines.list import list_machines
|
from clan_cli.machines.list import list_machines
|
||||||
from clan_cli.nix import nix_config, nix_shell, nix_test_store
|
from clan_cli.nix import nix_config, nix_shell, nix_test_store
|
||||||
from clan_cli.vars._types import StoreBase
|
from clan_cli.vars._types import StoreBase
|
||||||
from clan_cli.vars.migration import check_can_migrate, migrate_files
|
from clan_cli.vars.migration import check_can_migrate, migrate_files
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from .check import check_vars
|
from .check import check_vars
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import logging
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from .generate import Var
|
from .generate import Var
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from collections.abc import Iterable
|
|||||||
from graphlib import TopologicalSorter
|
from graphlib import TopologicalSorter
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .generate import Generator
|
from .generate import Generator
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import logging
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.secrets.key import generate_key
|
from clan_cli.secrets.key import generate_key
|
||||||
from clan_cli.secrets.sops import maybe_get_admin_public_key
|
from clan_cli.secrets.sops import maybe_get_admin_public_key
|
||||||
from clan_cli.secrets.users import add_user
|
from clan_cli.secrets.users import add_user
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import argparse
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from ._types import GeneratorUpdate
|
from ._types import GeneratorUpdate
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import logging
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.git import commit_files
|
from clan_cli.git import commit_files
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from dataclasses import dataclass
|
|||||||
from getpass import getpass
|
from getpass import getpass
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import shutil
|
|||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.ssh.host import Host
|
from clan_cli.ssh.host import Host
|
||||||
from clan_cli.vars._types import StoreBase
|
from clan_cli.vars._types import StoreBase
|
||||||
from clan_cli.vars.generate import Generator, Var
|
from clan_cli.vars.generate import Generator, Var
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
|
|
||||||
class FactStore(StoreBase):
|
class FactStore(StoreBase):
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ from collections.abc import Iterable
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.dirs import vm_state_dir
|
from clan_cli.dirs import vm_state_dir
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.ssh.host import Host
|
from clan_cli.ssh.host import Host
|
||||||
from clan_cli.vars._types import StoreBase
|
from clan_cli.vars._types import StoreBase
|
||||||
from clan_cli.vars.generate import Generator, Var
|
from clan_cli.vars.generate import Generator, Var
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from pathlib import Path
|
|||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.secrets import sops
|
from clan_cli.secrets import sops
|
||||||
from clan_cli.secrets.folders import (
|
from clan_cli.secrets.folders import (
|
||||||
@@ -28,6 +27,7 @@ from clan_cli.ssh.upload import upload
|
|||||||
from clan_cli.vars._types import StoreBase
|
from clan_cli.vars._types import StoreBase
|
||||||
from clan_cli.vars.generate import Generator
|
from clan_cli.vars.generate import Generator
|
||||||
from clan_cli.vars.var import Var
|
from clan_cli.vars.var import Var
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ from contextlib import contextmanager
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.qemu.qmp import QEMUMonitorProtocol
|
from clan_cli.qemu.qmp import QEMUMonitorProtocol
|
||||||
|
|
||||||
from .inspect import VmConfig
|
from .inspect import VmConfig
|
||||||
@@ -74,7 +75,7 @@ def graphics_options(vm: VmConfig) -> GraphicOptions:
|
|||||||
"-device", "usb-ccid",
|
"-device", "usb-ccid",
|
||||||
"-chardev", "spicevmc,id=ccid,name=smartcard",
|
"-chardev", "spicevmc,id=ccid,name=smartcard",
|
||||||
], None)
|
], None)
|
||||||
# fmt: on
|
# fmt: on
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -140,19 +141,31 @@ def qemu_command(
|
|||||||
"-device", "virtserialport,chardev=qga0,name=org.qemu.guest_agent.0",
|
"-device", "virtserialport,chardev=qga0,name=org.qemu.guest_agent.0",
|
||||||
] # fmt: on
|
] # fmt: on
|
||||||
if interactive:
|
if interactive:
|
||||||
command.extend([
|
command.extend(
|
||||||
"-serial", "null",
|
[
|
||||||
"-chardev", "stdio,mux=on,id=char0,signal=off",
|
"-serial",
|
||||||
"-mon", "chardev=char0,mode=readline",
|
"null",
|
||||||
"-device", "virtconsole,chardev=char0,nr=0",
|
"-chardev",
|
||||||
])
|
"stdio,mux=on,id=char0,signal=off",
|
||||||
|
"-mon",
|
||||||
|
"chardev=char0,mode=readline",
|
||||||
|
"-device",
|
||||||
|
"virtconsole,chardev=char0,nr=0",
|
||||||
|
]
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
command.extend([
|
command.extend(
|
||||||
"-serial", "null",
|
[
|
||||||
"-chardev", "file,id=char0,path=/dev/stdout",
|
"-serial",
|
||||||
"-device", "virtconsole,chardev=char0,nr=0",
|
"null",
|
||||||
"-monitor", "none",
|
"-chardev",
|
||||||
])
|
"file,id=char0,path=/dev/stdout",
|
||||||
|
"-device",
|
||||||
|
"virtconsole,chardev=char0,nr=0",
|
||||||
|
"-monitor",
|
||||||
|
"none",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
vsock_cid = None
|
vsock_cid = None
|
||||||
if vm.graphics:
|
if vm.graphics:
|
||||||
|
|||||||
@@ -12,10 +12,11 @@ from dataclasses import dataclass
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanCmdError, ClanError
|
||||||
|
|
||||||
from clan_cli.cmd import CmdOut, Log, RunOpts, handle_io, run
|
from clan_cli.cmd import CmdOut, Log, RunOpts, handle_io, run
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.dirs import module_root, user_cache_dir, vm_state_dir
|
from clan_cli.dirs import module_root, user_cache_dir, vm_state_dir
|
||||||
from clan_cli.errors import ClanCmdError, ClanError
|
|
||||||
from clan_cli.facts.generate import generate_facts
|
from clan_cli.facts.generate import generate_facts
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.nix import nix_shell
|
from clan_cli.nix import nix_shell
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import time
|
|||||||
from collections.abc import Iterator
|
from collections.abc import Iterator
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.nix import nix_shell
|
from clan_cli.nix import nix_shell
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import subprocess
|
|||||||
import time
|
import time
|
||||||
from collections.abc import Iterator
|
from collections.abc import Iterator
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_cli.nix import nix_shell
|
from clan_cli.nix import nix_shell
|
||||||
|
|
||||||
VMADDR_CID_HYPERVISOR = 2
|
VMADDR_CID_HYPERVISOR = 2
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ from .serde import dataclass_to_dict, from_dict, sanitize_string
|
|||||||
|
|
||||||
__all__ = ["dataclass_to_dict", "from_dict", "sanitize_string"]
|
__all__ = ["dataclass_to_dict", "from_dict", "sanitize_string"]
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
T = TypeVar("T")
|
T = TypeVar("T")
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ from pathlib import Path
|
|||||||
from typing import Any, Literal
|
from typing import Any, Literal
|
||||||
|
|
||||||
from clan_cli.cmd import RunOpts, run
|
from clan_cli.cmd import RunOpts, run
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.nix import nix_shell
|
from clan_cli.nix import nix_shell
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from . import API
|
from . import API
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ from typing import Any, TypedDict
|
|||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from clan_cli.dirs import TemplateType, clan_templates
|
from clan_cli.dirs import TemplateType, clan_templates
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.git import commit_file
|
from clan_cli.git import commit_file
|
||||||
from clan_cli.machines.hardware import HardwareConfig, show_machine_hardware_config
|
from clan_cli.machines.hardware import HardwareConfig, show_machine_hardware_config
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
from clan_lib.api.modules import Frontmatter, extract_frontmatter
|
from clan_lib.api.modules import Frontmatter, extract_frontmatter
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ from dataclasses import dataclass, field
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, TypedDict
|
from typing import Any, TypedDict
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from . import API
|
from . import API
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ from dataclasses import dataclass
|
|||||||
from typing import Literal
|
from typing import Literal
|
||||||
|
|
||||||
from clan_cli.cmd import RunOpts
|
from clan_cli.cmd import RunOpts
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Dependencies:
|
|||||||
- pydantic: A library for data validation and settings management.
|
- pydantic: A library for data validation and settings management.
|
||||||
- pydantic_core: Core functionality for Pydantic.
|
- pydantic_core: Core functionality for Pydantic.
|
||||||
|
|
||||||
Note: This module assumes the presence of other modules and classes such as `ClanError` and `ErrorDetails` from the `clan_cli.errors` module.
|
Note: This module assumes the presence of other modules and classes such as `ClanError` and `ErrorDetails` from the `clan_lib.errors` module.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import dataclasses
|
import dataclasses
|
||||||
@@ -45,7 +45,7 @@ from typing import (
|
|||||||
is_typeddict,
|
is_typeddict,
|
||||||
)
|
)
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
|
|
||||||
def sanitize_string(s: str) -> str:
|
def sanitize_string(s: str) -> str:
|
||||||
|
|||||||
@@ -7,17 +7,7 @@ from pathlib import Path
|
|||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from clan_cli.cmd import Log, RunOpts, run
|
from clan_lib.errors import ClanError
|
||||||
from clan_cli.dirs import nixpkgs_source, select_source, user_cache_dir
|
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.nix import (
|
|
||||||
nix_build,
|
|
||||||
nix_command,
|
|
||||||
nix_config,
|
|
||||||
nix_eval,
|
|
||||||
nix_metadata,
|
|
||||||
nix_test_store,
|
|
||||||
)
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -624,6 +614,11 @@ class Flake:
|
|||||||
"""
|
"""
|
||||||
Loads the flake into the store and populates self.store_path and self.hash such that the flake can evaluate locally and offline
|
Loads the flake into the store and populates self.store_path and self.hash such that the flake can evaluate locally and offline
|
||||||
"""
|
"""
|
||||||
|
from clan_cli.cmd import run
|
||||||
|
from clan_cli.nix import (
|
||||||
|
nix_command,
|
||||||
|
)
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
"flake",
|
"flake",
|
||||||
"prefetch",
|
"prefetch",
|
||||||
@@ -649,6 +644,11 @@ class Flake:
|
|||||||
|
|
||||||
This method is used to refresh the cache by reloading it from the flake.
|
This method is used to refresh the cache by reloading it from the flake.
|
||||||
"""
|
"""
|
||||||
|
from clan_cli.dirs import user_cache_dir
|
||||||
|
from clan_cli.nix import (
|
||||||
|
nix_metadata,
|
||||||
|
)
|
||||||
|
|
||||||
self.prefetch()
|
self.prefetch()
|
||||||
|
|
||||||
self._cache = FlakeCache()
|
self._cache = FlakeCache()
|
||||||
@@ -697,6 +697,14 @@ class Flake:
|
|||||||
ClanError: If the number of outputs does not match the number of selectors.
|
ClanError: If the number of outputs does not match the number of selectors.
|
||||||
AssertionError: If the cache or flake cache path is not properly initialized.
|
AssertionError: If the cache or flake cache path is not properly initialized.
|
||||||
"""
|
"""
|
||||||
|
from clan_cli.cmd import Log, RunOpts, run
|
||||||
|
from clan_cli.dirs import nixpkgs_source, select_source
|
||||||
|
from clan_cli.nix import (
|
||||||
|
nix_build,
|
||||||
|
nix_config,
|
||||||
|
nix_test_store,
|
||||||
|
)
|
||||||
|
|
||||||
if self._cache is None:
|
if self._cache is None:
|
||||||
self.invalidate_cache()
|
self.invalidate_cache()
|
||||||
assert self._cache is not None
|
assert self._cache is not None
|
||||||
@@ -786,6 +794,12 @@ class Flake:
|
|||||||
> '{ ...JSONSchema... }'
|
> '{ ...JSONSchema... }'
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
from clan_cli.cmd import Log, RunOpts, run
|
||||||
|
from clan_cli.nix import (
|
||||||
|
nix_eval,
|
||||||
|
nix_test_store,
|
||||||
|
)
|
||||||
|
|
||||||
# Always prefetch, so we don't get any stale information
|
# Always prefetch, so we don't get any stale information
|
||||||
self.prefetch()
|
self.prefetch()
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import json
|
import json
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.git import commit_file
|
from clan_cli.git import commit_file
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
from clan_lib.nix_models.inventory import Inventory
|
from clan_lib.nix_models.inventory import Inventory
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ flattening, unmerging lists, finding duplicates, and calculating patches.
|
|||||||
from collections import Counter
|
from collections import Counter
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
|
|
||||||
def flatten_data(data: dict, parent_key: str = "", separator: str = ".") -> dict:
|
def flatten_data(data: dict, parent_key: str = "", separator: str = ".") -> dict:
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.persist.util import (
|
from clan_lib.persist.util import (
|
||||||
apply_patch,
|
apply_patch,
|
||||||
calc_patches,
|
calc_patches,
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import clan_cli.clan.create
|
|||||||
import pytest
|
import pytest
|
||||||
from clan_cli.cmd import RunOpts, run
|
from clan_cli.cmd import RunOpts, run
|
||||||
from clan_cli.dirs import specific_machine_dir
|
from clan_cli.dirs import specific_machine_dir
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.inventory import patch_inventory_with
|
from clan_cli.inventory import patch_inventory_with
|
||||||
from clan_cli.machines.create import CreateOptions as ClanCreateOptions
|
from clan_cli.machines.create import CreateOptions as ClanCreateOptions
|
||||||
from clan_cli.machines.create import create_machine
|
from clan_cli.machines.create import create_machine
|
||||||
@@ -25,6 +24,7 @@ from clan_cli.vars.generate import generate_vars_for_machine, get_generators_clo
|
|||||||
|
|
||||||
from clan_lib.api.disk import hw_main_disk_options, set_machine_disk_schema
|
from clan_lib.api.disk import hw_main_disk_options, set_machine_disk_schema
|
||||||
from clan_lib.api.network import check_machine_online
|
from clan_lib.api.network import check_machine_online
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
from clan_lib.nix_models.inventory import Machine as InventoryMachine
|
from clan_lib.nix_models.inventory import Machine as InventoryMachine
|
||||||
from clan_lib.nix_models.inventory import MachineDeploy
|
from clan_lib.nix_models.inventory import MachineDeploy
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from typing import Any, Generic, TypeVar
|
|||||||
import gi
|
import gi
|
||||||
|
|
||||||
gi.require_version("Gio", "2.0")
|
gi.require_version("Gio", "2.0")
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
from gi.repository import Gio, GObject
|
from gi.repository import Gio, GObject
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ from typing import Any
|
|||||||
|
|
||||||
from clan_cli.clan.inspect import FlakeConfig, inspect_flake
|
from clan_cli.clan.inspect import FlakeConfig, inspect_flake
|
||||||
from clan_cli.dirs import user_history_file
|
from clan_cli.dirs import user_history_file
|
||||||
from clan_cli.errors import ClanError
|
|
||||||
from clan_cli.locked_open import read_history_file, write_history_file
|
from clan_cli.locked_open import read_history_file, write_history_file
|
||||||
from clan_cli.machines.list import list_machines
|
from clan_cli.machines.list import list_machines
|
||||||
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake.flake import Flake
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
from clan_vm_manager.clan_uri import ClanURI
|
from clan_vm_manager.clan_uri import ClanURI
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from functools import partial
|
|||||||
from typing import Any, TypeVar
|
from typing import Any, TypeVar
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
from clan_cli.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
from clan_vm_manager.clan_uri import ClanURI
|
from clan_vm_manager.clan_uri import ClanURI
|
||||||
from clan_vm_manager.components.gkvstore import GKVStore
|
from clan_vm_manager.components.gkvstore import GKVStore
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ from tempfile import NamedTemporaryFile
|
|||||||
from typing import Any, override
|
from typing import Any, override
|
||||||
|
|
||||||
from clan_cli.dirs import find_git_repo_root
|
from clan_cli.dirs import find_git_repo_root
|
||||||
from clan_cli.flake import Flake
|
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_cli.machines.machines import Machine
|
||||||
from clan_cli.nix import nix_config, nix_eval
|
from clan_cli.nix import nix_config, nix_eval
|
||||||
from clan_cli.vars.generate import generate_vars
|
from clan_cli.vars.generate import generate_vars
|
||||||
|
from clan_lib.flake.flake import Flake
|
||||||
|
|
||||||
sops_priv_key = (
|
sops_priv_key = (
|
||||||
"AGE-SECRET-KEY-1PL0M9CWRCG3PZ9DXRTTLMCVD57U6JDFE8K7DNVQ35F4JENZ6G3MQ0RQLRV"
|
"AGE-SECRET-KEY-1PL0M9CWRCG3PZ9DXRTTLMCVD57U6JDFE8K7DNVQ35F4JENZ6G3MQ0RQLRV"
|
||||||
|
|||||||
Reference in New Issue
Block a user