changed method name and added inheritance for 'Software' class, moved 'SSHKey' related classes to separate file and fixed 'Software' instance method call

This commit is contained in:
2026-01-07 12:07:07 -05:00
parent f46d397e3c
commit e412e3d5ab
2 changed files with 152 additions and 59 deletions

View File

@@ -4,10 +4,10 @@ Library of classes modeling Ansible nodes or their types.
from enum import Enum
from pathlib import Path, PurePath
from typing import TypeAlias as Neotype, TypedDict as Dict
from typing import Never, Union, Literal, Required, Self
from typing import TypedDict as Dict
from typing import Union, Literal, Required, Self
from custtypes import ExecutedPath, IdlePath, VirtualPrivateServers, AnsibleScopes
from softman import Software, SoftPathGroup, SoftScope, Apps
from softman import Software, SoftPathGroup, SoftScope, Apps, Softs
from whereami import USER_PATH, PROJ_ROOT
from ansible_vault import Vault
import secrets
@@ -71,9 +71,6 @@ class ControlNode:
def sys_data(self) -> ExecutedPath:
return self.__data_paths
class Softs(Enum):
ssh = 0
# userSSHParams = Dict("userSSHParams", {
# "username": Required[str],
# "paths": Apps,
@@ -119,7 +116,7 @@ class RemoteNode:
SoftScope.GLOBAL.name: PurePath(str(cnode.sys_confs[0]), "update-motd.d")
}
}
self.root["software"].declare(Softs.ssh.name, **app_input)
self.root["software"].append(Softs.ssh.name, **app_input)
self._fqdn = name
self.root["software"]._fqdn = name
@@ -136,12 +133,7 @@ class RemoteNode:
self._api_key: str | None = api_key
self.service = service
self.region = region
self.__authkeys_selected = False
self.__usedkeys_selected = False
self.__keys_selected = False
self.__finalized_keys = False
self.model: dict | None = None
self.__key_accumulator: tuple | list | None = []
def set_region(self, name: Literal["us-east"] = "us-east") -> None:
self.region = name