from .Credentials import CredentialCollection
from .LocalMachine import LocalMachine
from .SSHMachine import SSHMachine
from .SSHClient import SSHClient

LMZ_COMMON_CREDENTIALS = CredentialCollection(
    username="root",
    password="paedmllinux",
    private_keyfile="/root/.ssh/id_rsa",
    public_keyfile="/root/.ssh/id_rsa.pub",
    ldap_base="dc=paedml-linux,dc=lokal",
    domainname="paedml-linux.lokal"
)

class PaedMLMachineCollection:
    def __init__(self):
        self.server = LocalMachine()
        self.backup = SSHMachine(SSHClient(LMZ_COMMON_CREDENTIALS, 'backup.paedml-linux.lokal'))
        self.firewall = SSHMachine(SSHClient(LMZ_COMMON_CREDENTIALS, 'firewall.paedml-linux.lokal'))

        self.local_machine = self.server
        self.initialized = False

    def initialize(self):
        self.server.initialize()
        self.backup.initialize()
        self.firewall.initialize()
        self.initialized = True

MACHINE_COLLECTION = PaedMLMachineCollection()