modernize code with ruff
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import argparse
|
||||
import json
|
||||
import subprocess
|
||||
from typing import Optional
|
||||
|
||||
from ..errors import ClanError
|
||||
from ..machines.machines import Machine
|
||||
|
||||
|
||||
def create_backup(machine: Machine, provider: Optional[str] = None) -> None:
|
||||
def create_backup(machine: Machine, provider: str | None = None) -> None:
|
||||
backup_scripts = json.loads(
|
||||
machine.eval_nix(f"nixosConfigurations.{machine.name}.config.clanCore.backups")
|
||||
)
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import argparse
|
||||
import pprint
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from ..errors import ClanError
|
||||
|
||||
|
||||
def list_backups(
|
||||
flake_dir: Path, machine: str, provider: Optional[str] = None
|
||||
flake_dir: Path, machine: str, provider: str | None = None
|
||||
) -> dict[str, dict[str, list[dict[str, str]]]]:
|
||||
dummy_data = {
|
||||
"testhostname": {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from ..errors import ClanError
|
||||
|
||||
@@ -10,7 +9,7 @@ def restore_backup(
|
||||
machine: str,
|
||||
provider: str,
|
||||
backup_id: str,
|
||||
service: Optional[str] = None,
|
||||
service: str | None = None,
|
||||
) -> None:
|
||||
if service is None:
|
||||
print("would restore backup", machine, provider, backup_id)
|
||||
|
||||
Reference in New Issue
Block a user