clan-cli: Move Machine object to clan_lib
This commit is contained in:
@@ -3,13 +3,13 @@ import logging
|
|||||||
|
|
||||||
from clan_lib.backups.create import create_backup
|
from clan_lib.backups.create import create_backup
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
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.machines.machines import Machine
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import argparse
|
|||||||
|
|
||||||
from clan_lib.backups.list import list_backups
|
from clan_lib.backups.list import list_backups
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
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.machines.machines import Machine
|
|
||||||
|
|
||||||
|
|
||||||
def list_command(args: argparse.Namespace) -> None:
|
def list_command(args: argparse.Namespace) -> None:
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import argparse
|
|||||||
|
|
||||||
from clan_lib.backups.restore import restore_backup
|
from clan_lib.backups.restore import restore_backup
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
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.machines.machines import Machine
|
|
||||||
|
|
||||||
|
|
||||||
def restore_command(args: argparse.Namespace) -> None:
|
def restore_command(args: argparse.Namespace) -> None:
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from clan_lib.cmd import run
|
|||||||
from clan_lib.dirs import machine_gcroot
|
from clan_lib.dirs import machine_gcroot
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import (
|
from clan_lib.nix import (
|
||||||
nix_add_to_gcroots,
|
nix_add_to_gcroots,
|
||||||
nix_build,
|
nix_build,
|
||||||
@@ -16,7 +17,6 @@ from clan_lib.nix import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
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.vms.inspect import VmConfig, inspect_vm
|
from clan_cli.vms.inspect import VmConfig, inspect_vm
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ from tempfile import TemporaryDirectory
|
|||||||
from clan_lib.cmd import RunOpts, run
|
from clan_lib.cmd import RunOpts, run
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.git import commit_files
|
from clan_lib.git import commit_files
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_shell
|
from clan_lib.nix import nix_shell
|
||||||
|
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
@@ -18,7 +19,6 @@ from clan_cli.completions import (
|
|||||||
complete_services_for_machine,
|
complete_services_for_machine,
|
||||||
)
|
)
|
||||||
from clan_cli.machines.list import list_machines
|
from clan_cli.machines.list import list_machines
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
from .check import check_secrets
|
from .check import check_secrets
|
||||||
from .public_modules import FactStoreBase
|
from .public_modules import FactStoreBase
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ import argparse
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import clan_cli.machines.machines as machines
|
import clan_lib.machines.machines as machines
|
||||||
|
|
||||||
|
|
||||||
class FactStoreBase(ABC):
|
class FactStoreBase(ABC):
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
from . import FactStoreBase
|
from . import FactStoreBase
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
from clan_lib.dirs import vm_state_dir
|
from clan_lib.dirs import vm_state_dir
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
from . import FactStoreBase
|
from . import FactStoreBase
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,9 @@ from __future__ import annotations
|
|||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import clan_lib.machines.machines as machines
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
import clan_cli.machines.machines as machines
|
|
||||||
|
|
||||||
|
|
||||||
class SecretStoreBase(ABC):
|
class SecretStoreBase(ABC):
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ from pathlib import Path
|
|||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from clan_lib.cmd import Log, RunOpts
|
from clan_lib.cmd import Log, RunOpts
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_shell
|
from clan_lib.nix import nix_shell
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
from clan_cli.facts.secret_modules import SecretStoreBase
|
from clan_cli.facts.secret_modules import SecretStoreBase
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
|
|
||||||
class SecretStore(SecretStoreBase):
|
class SecretStore(SecretStoreBase):
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.secrets.folders import sops_secrets_folder
|
from clan_cli.secrets.folders import sops_secrets_folder
|
||||||
from clan_cli.secrets.machines import add_machine, has_machine
|
from clan_cli.secrets.machines import add_machine, has_machine
|
||||||
from clan_cli.secrets.secrets import decrypt_secret, encrypt_secret, has_secret
|
from clan_cli.secrets.secrets import decrypt_secret, encrypt_secret, has_secret
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ from pathlib import Path
|
|||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from clan_lib.dirs import vm_state_dir
|
from clan_lib.dirs import vm_state_dir
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
from . import SecretStoreBase
|
from . import SecretStoreBase
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ import logging
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.ssh.upload import upload
|
from clan_cli.ssh.upload import upload
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
from clan_lib.cmd import Log, RunOpts, run
|
from clan_lib.cmd import Log, RunOpts, run
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ from typing import Any
|
|||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
from clan_lib.cmd import Log, RunOpts, cmd_with_root, run
|
from clan_lib.cmd import Log, RunOpts, cmd_with_root, run
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_shell
|
from clan_lib.nix import nix_shell
|
||||||
|
|
||||||
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.vars.generate import generate_vars
|
from clan_cli.vars.generate import generate_vars
|
||||||
from clan_cli.vars.upload import populate_secret_vars
|
from clan_cli.vars.upload import populate_secret_vars
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ from pathlib import Path
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
from .flash import Disk, SystemConfig, flash_machine
|
from .flash import Disk, SystemConfig, flash_machine
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ from pathlib import Path
|
|||||||
from clan_lib import inventory
|
from clan_lib import inventory
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
from clan_lib.dirs import specific_machine_dir
|
from clan_lib.dirs import specific_machine_dir
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.secrets.folders import sops_secrets_folder
|
from clan_cli.secrets.folders import sops_secrets_folder
|
||||||
from clan_cli.secrets.machines import has_machine as secrets_has_machine
|
from clan_cli.secrets.machines import has_machine as secrets_has_machine
|
||||||
from clan_cli.secrets.machines import remove_machine as secrets_machine_remove
|
from clan_cli.secrets.machines import remove_machine as secrets_machine_remove
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ from clan_lib.cmd import RunOpts, run
|
|||||||
from clan_lib.dirs import specific_machine_dir
|
from clan_lib.dirs import specific_machine_dir
|
||||||
from clan_lib.errors import ClanCmdError, ClanError
|
from clan_lib.errors import ClanCmdError, ClanError
|
||||||
from clan_lib.git import commit_file
|
from clan_lib.git import commit_file
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_config, nix_eval
|
from clan_lib.nix import nix_config, nix_eval
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
from .types import machine_name_type
|
from .types import machine_name_type
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ from tempfile import TemporaryDirectory
|
|||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
from clan_lib.cmd import Log, RunOpts, run
|
from clan_lib.cmd import Log, RunOpts, run
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_shell
|
from clan_lib.nix import nix_shell
|
||||||
|
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
@@ -19,7 +20,6 @@ from clan_cli.completions import (
|
|||||||
)
|
)
|
||||||
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.ssh.deploy_info import DeployInfo, find_reachable_host, ssh_command_parse
|
from clan_cli.ssh.deploy_info import DeployInfo, find_reachable_host, ssh_command_parse
|
||||||
from clan_cli.ssh.host_key import HostKeyCheck
|
from clan_cli.ssh.host_key import HostKeyCheck
|
||||||
from clan_cli.vars.generate import generate_vars
|
from clan_cli.vars.generate import generate_vars
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
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.machines.machines import Machine
|
|
||||||
|
|
||||||
|
|
||||||
@API.register
|
@API.register
|
||||||
def get_machine(machine: Machine) -> InventoryMachine:
|
def get_machine(machine: Machine) -> InventoryMachine:
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ from clan_lib.api.modules import parse_frontmatter
|
|||||||
from clan_lib.dirs import specific_machine_dir
|
from clan_lib.dirs import specific_machine_dir
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix_models.inventory import Machine as InventoryMachine
|
from clan_lib.nix_models.inventory import Machine as InventoryMachine
|
||||||
from clan_lib.persist.inventory_store import InventoryStore
|
from clan_lib.persist.inventory_store import InventoryStore
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_tags
|
from clan_cli.completions import add_dynamic_completer, complete_tags
|
||||||
from clan_cli.machines.hardware import HardwareConfig
|
from clan_cli.machines.hardware import HardwareConfig
|
||||||
from clan_cli.machines.inventory import get_machine
|
from clan_cli.machines.inventory import get_machine
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
# Functions to test
|
# Functions to test
|
||||||
from clan_cli.tests.fixtures_flakes import FlakeForTest
|
from clan_cli.tests.fixtures_flakes import FlakeForTest
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ from clan_lib.cmd import Log, RunOpts, run
|
|||||||
from clan_lib.dirs import get_clan_flake_toplevel_or_env
|
from clan_lib.dirs import get_clan_flake_toplevel_or_env
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_build, nix_command
|
from clan_lib.nix import nix_build, nix_command
|
||||||
from clan_lib.nix_models.inventory import Machine as InventoryMachine
|
from clan_lib.nix_models.inventory import Machine as InventoryMachine
|
||||||
|
|
||||||
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.vars.generate import generate_vars
|
from clan_cli.vars.generate import generate_vars
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ from clan_lib.async_run import AsyncContext, AsyncOpts, AsyncRuntime, is_async_c
|
|||||||
from clan_lib.cmd import Log, MsgColor, RunOpts, run
|
from clan_lib.cmd import Log, MsgColor, RunOpts, run
|
||||||
from clan_lib.colors import AnsiColor
|
from clan_lib.colors import AnsiColor
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_command, nix_config, nix_metadata
|
from clan_lib.nix import nix_command, nix_config, nix_metadata
|
||||||
from clan_lib.ssh.remote import HostKeyCheck, Remote
|
from clan_lib.ssh.remote import HostKeyCheck, Remote
|
||||||
|
|
||||||
@@ -21,7 +22,6 @@ from clan_cli.completions import (
|
|||||||
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
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.vars.generate import generate_vars
|
from clan_cli.vars.generate import generate_vars
|
||||||
from clan_cli.vars.upload import upload_secret_vars
|
from clan_cli.vars.upload import upload_secret_vars
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from typing import Any
|
|||||||
from clan_lib.async_run import AsyncRuntime
|
from clan_lib.async_run import AsyncRuntime
|
||||||
from clan_lib.cmd import run
|
from clan_lib.cmd import run
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_shell
|
from clan_lib.nix import nix_shell
|
||||||
from clan_lib.ssh.parse import parse_deployment_address
|
from clan_lib.ssh.parse import parse_deployment_address
|
||||||
from clan_lib.ssh.remote import Remote, is_ssh_reachable
|
from clan_lib.ssh.remote import Remote, is_ssh_reachable
|
||||||
@@ -17,7 +18,6 @@ from clan_cli.completions import (
|
|||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
complete_machines,
|
complete_machines,
|
||||||
)
|
)
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.ssh.host_key import HostKeyCheck
|
from clan_cli.ssh.host_key import HostKeyCheck
|
||||||
from clan_cli.ssh.tor import TorTarget, spawn_tor, ssh_tor_reachable
|
from clan_cli.ssh.tor import TorTarget, spawn_tor, ssh_tor_reachable
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from pathlib import Path
|
|||||||
from clan_lib.cmd import RunOpts, run
|
from clan_lib.cmd import RunOpts, run
|
||||||
from clan_lib.dirs import get_clan_flake_toplevel_or_env
|
from clan_lib.dirs import get_clan_flake_toplevel_or_env
|
||||||
from clan_lib.errors import ClanCmdError, ClanError
|
from clan_lib.errors import ClanCmdError, ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_eval
|
from clan_lib.nix import nix_eval
|
||||||
|
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
@@ -13,7 +14,6 @@ from clan_cli.completions import (
|
|||||||
complete_machines,
|
complete_machines,
|
||||||
complete_state_services_for_machine,
|
complete_state_services_for_machine,
|
||||||
)
|
)
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ from pathlib import Path
|
|||||||
from typing import Any, NamedTuple
|
from typing import Any, NamedTuple
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.tests import age_keys
|
from clan_cli.tests import age_keys
|
||||||
from clan_cli.tests.fixture_error import FixtureError
|
from clan_cli.tests.fixture_error import FixtureError
|
||||||
from clan_cli.tests.root import CLAN_CORE
|
from clan_cli.tests.root import CLAN_CORE
|
||||||
@@ -23,6 +22,7 @@ from clan_lib.dirs import (
|
|||||||
)
|
)
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
from clan_lib.locked_open import locked_open
|
from clan_lib.locked_open import locked_open
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_test_store
|
from clan_lib.nix import nix_test_store
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ from clan_lib.persist.inventory_store import InventoryStore
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .age_keys import KeyPair
|
from .age_keys import KeyPair
|
||||||
|
|
||||||
from clan_cli.machines.machines import Machine as MachineMachine
|
|
||||||
from clan_cli.tests.helpers import cli
|
from clan_cli.tests.helpers import cli
|
||||||
|
from clan_lib.machines.machines import Machine as MachineMachine
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.with_core
|
@pytest.mark.with_core
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ from typing import TYPE_CHECKING
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from clan_cli.facts.secret_modules.sops import SecretStore
|
from clan_cli.facts.secret_modules.sops import SecretStore
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.secrets.folders import sops_secrets_folder
|
from clan_cli.secrets.folders import sops_secrets_folder
|
||||||
from clan_cli.tests.fixtures_flakes import FlakeForTest
|
from clan_cli.tests.fixtures_flakes import FlakeForTest
|
||||||
from clan_cli.tests.helpers import cli
|
from clan_cli.tests.helpers import cli
|
||||||
from clan_cli.tests.helpers.validator import is_valid_age_key
|
from clan_cli.tests.helpers.validator import is_valid_age_key
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .age_keys import KeyPair
|
from .age_keys import KeyPair
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import shutil
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.tests.age_keys import SopsSetup
|
from clan_cli.tests.age_keys import SopsSetup
|
||||||
from clan_cli.tests.fixtures_flakes import ClanFlake
|
from clan_cli.tests.fixtures_flakes import ClanFlake
|
||||||
from clan_cli.tests.helpers import cli
|
from clan_cli.tests.helpers import cli
|
||||||
@@ -23,6 +22,7 @@ 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.errors import ClanError
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_eval, run
|
from clan_lib.nix import nix_eval, run
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import sys
|
|||||||
from contextlib import ExitStack
|
from contextlib import ExitStack
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.tests.age_keys import SopsSetup
|
from clan_cli.tests.age_keys import SopsSetup
|
||||||
from clan_cli.tests.fixtures_flakes import ClanFlake
|
from clan_cli.tests.fixtures_flakes import ClanFlake
|
||||||
from clan_cli.tests.helpers import cli
|
from clan_cli.tests.helpers import cli
|
||||||
@@ -12,6 +11,7 @@ from clan_cli.tests.nix_config import ConfigItem
|
|||||||
from clan_cli.vms.run import inspect_vm, spawn_vm
|
from clan_cli.vms.run import inspect_vm, spawn_vm
|
||||||
from clan_lib import cmd
|
from clan_lib import cmd
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_eval, run
|
from clan_lib.nix import nix_eval, run
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ from pathlib import Path
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.tests.fixtures_flakes import ClanFlake, FlakeForTest
|
from clan_cli.tests.fixtures_flakes import ClanFlake, FlakeForTest
|
||||||
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_cli.vms.run import inspect_vm, spawn_vm
|
from clan_cli.vms.run import inspect_vm, spawn_vm
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .age_keys import KeyPair
|
from .age_keys import KeyPair
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ 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.machines import machines
|
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines import machines
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
|||||||
@@ -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.machines.machines import Machine
|
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
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.machines.machines import Machine
|
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ from .var import Var
|
|||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -356,7 +356,7 @@ def get_generators_closure(
|
|||||||
full_closure: bool = False,
|
full_closure: bool = False,
|
||||||
include_previous_values: bool = False,
|
include_previous_values: bool = False,
|
||||||
) -> list[Generator]:
|
) -> list[Generator]:
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
return get_closure(
|
return get_closure(
|
||||||
machine=Machine(name=machine_name, flake=Flake(str(base_dir))),
|
machine=Machine(name=machine_name, flake=Flake(str(base_dir))),
|
||||||
@@ -395,7 +395,7 @@ def generate_vars_for_machine(
|
|||||||
base_dir: Path,
|
base_dir: Path,
|
||||||
no_sandbox: bool = False,
|
no_sandbox: bool = False,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
machine = Machine(name=machine_name, flake=Flake(str(base_dir)))
|
machine = Machine(name=machine_name, flake=Flake(str(base_dir)))
|
||||||
generators_set = set(generators)
|
generators_set = set(generators)
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ 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.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.errors import ClanError
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
from ._types import GeneratorUpdate
|
from ._types import GeneratorUpdate
|
||||||
from .generate import Generator, Prompt, Var, execute_generator
|
from .generate import Generator, Prompt, Var, execute_generator
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ from clan_lib.git import commit_files
|
|||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.vars.generate import Generator
|
from clan_cli.vars.generate import Generator
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
|
|
||||||
def _migration_file_exists(
|
def _migration_file_exists(
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import shutil
|
|||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
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
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import shutil
|
|||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
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.dirs import vm_state_dir
|
from clan_lib.dirs import vm_state_dir
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import shutil
|
|||||||
import tempfile
|
import tempfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
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.machines.machines import Machine
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ from itertools import chain
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.ssh.upload import upload
|
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, Var
|
from clan_cli.vars.generate import Generator, Var
|
||||||
from clan_lib.cmd import CmdOut, Log, RunOpts, run
|
from clan_lib.cmd import CmdOut, Log, RunOpts, run
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_shell
|
from clan_lib.nix import nix_shell
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
|
|||||||
@@ -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.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 (
|
||||||
sops_groups_folder,
|
sops_groups_folder,
|
||||||
@@ -27,6 +26,7 @@ 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
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import shutil
|
|||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
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.dirs import vm_state_dir
|
from clan_lib.dirs import vm_state_dir
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ 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.machines.machines import Machine
|
|
||||||
from clan_cli.vars.get import get_var
|
from clan_cli.vars.get import get_var
|
||||||
from clan_cli.vars.prompt import PromptType
|
from clan_cli.vars.prompt import PromptType
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
from clan_lib.git import commit_files
|
from clan_lib.git import commit_files
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
from .generate import Var
|
from .generate import Var
|
||||||
from .prompt import ask
|
from .prompt import ask
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import logging
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ from pathlib import Path
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ from tempfile import TemporaryDirectory
|
|||||||
from clan_lib.cmd import CmdOut, Log, RunOpts, handle_io, run
|
from clan_lib.cmd import CmdOut, Log, RunOpts, handle_io, run
|
||||||
from clan_lib.dirs import module_root, user_cache_dir, vm_state_dir
|
from clan_lib.dirs import module_root, user_cache_dir, vm_state_dir
|
||||||
from clan_lib.errors import ClanCmdError, ClanError
|
from clan_lib.errors import ClanCmdError, ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_shell
|
from clan_lib.nix import nix_shell
|
||||||
|
|
||||||
from clan_cli.completions import add_dynamic_completer, complete_machines
|
from clan_cli.completions import add_dynamic_completer, complete_machines
|
||||||
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.qemu.qga import QgaSession
|
from clan_cli.qemu.qga import QgaSession
|
||||||
from clan_cli.qemu.qmp import QEMUMonitorProtocol
|
from clan_cli.qemu.qmp import QEMUMonitorProtocol
|
||||||
from clan_cli.vars.generate import generate_vars
|
from clan_cli.vars.generate import generate_vars
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ from typing import Any, TypedDict
|
|||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
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_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.dirs import TemplateType, clan_templates
|
from clan_lib.dirs import TemplateType, clan_templates
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.git import commit_file
|
from clan_lib.git import commit_file
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,10 @@ import time
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Literal
|
from typing import Literal
|
||||||
|
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
from clan_lib.api import API
|
from clan_lib.api import API
|
||||||
from clan_lib.cmd import RunOpts
|
from clan_lib.cmd import RunOpts
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ from pathlib import Path
|
|||||||
from typing import Any, Literal, TypedDict
|
from typing import Any, Literal, TypedDict
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
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
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines import machines
|
||||||
|
|
||||||
|
|
||||||
def test_simple() -> None:
|
def test_simple() -> None:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
|
|
||||||
def create_backup(machine: Machine, provider: str | None = None) -> None:
|
def create_backup(machine: Machine, provider: str | None = None) -> None:
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import json
|
import json
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
from clan_lib.cmd import Log, RunOpts
|
from clan_lib.cmd import Log, RunOpts
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
from clan_lib.cmd import Log, RunOpts
|
from clan_lib.cmd import Log, RunOpts
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,8 @@ from typing import TYPE_CHECKING
|
|||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
|
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
0
pkgs/clan-cli/clan_lib/machines/__init__.py
Normal file
0
pkgs/clan-cli/clan_lib/machines/__init__.py
Normal file
@@ -7,16 +7,16 @@ 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 import Flake
|
|
||||||
from clan_lib.nix import nix_config, nix_test_store
|
|
||||||
from clan_lib.ssh.remote import Remote
|
|
||||||
|
|
||||||
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.ssh.host_key import HostKeyCheck
|
from clan_cli.ssh.host_key import HostKeyCheck
|
||||||
from clan_cli.vars._types import StoreBase
|
from clan_cli.vars._types import StoreBase
|
||||||
|
|
||||||
|
from clan_lib.errors import ClanCmdError, ClanError
|
||||||
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.nix import nix_config, nix_test_store
|
||||||
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@@ -10,7 +10,6 @@ import clan_cli.clan.create
|
|||||||
import pytest
|
import pytest
|
||||||
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
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
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
|
||||||
@@ -24,6 +23,7 @@ from clan_lib.dirs import specific_machine_dir
|
|||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
from clan_lib.inventory import patch_inventory_with
|
from clan_lib.inventory import patch_inventory_with
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.nix import nix_command
|
from clan_lib.nix import nix_command
|
||||||
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
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ from typing import IO, ClassVar
|
|||||||
|
|
||||||
import gi
|
import gi
|
||||||
from clan_cli import vms
|
from clan_cli import vms
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_cli.vms.inspect import inspect_vm
|
from clan_cli.vms.inspect import inspect_vm
|
||||||
from clan_cli.vms.qemu import QMPWrapper
|
from clan_cli.vms.qemu import QMPWrapper
|
||||||
from clan_lib.dirs import vm_state_dir
|
from clan_lib.dirs import vm_state_dir
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
from clan_vm_manager.clan_uri import ClanURI
|
from clan_vm_manager.clan_uri import ClanURI
|
||||||
from clan_vm_manager.components.executor import MPProcess, spawn
|
from clan_vm_manager.components.executor import MPProcess, spawn
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from collections.abc import Callable
|
|||||||
from typing import Any, ClassVar, cast
|
from typing import Any, ClassVar, cast
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
from clan_cli.machines.machines import Machine
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ from pathlib import Path
|
|||||||
from typing import Any, ClassVar
|
from typing import Any, ClassVar
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
from clan_cli.machines.machines import Machine
|
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
from clan_vm_manager import assets
|
from clan_vm_manager import assets
|
||||||
from clan_vm_manager.clan_uri import ClanURI
|
from clan_vm_manager.clan_uri import ClanURI
|
||||||
|
|||||||
Reference in New Issue
Block a user