from puppeter import container from puppeter.domain.gateway.answers import AnswersProcessor from puppeter.presentation.answersprocessor import AnswersProcessorImpl from puppeter.presentation.app import App from puppeter.presentation.interactiveapp import InteractiveApp from puppeter.presentation.unattendedapp import UnattendedApp container.bind(AnswersProcessor, AnswersProcessorImpl) container.bind(App, InteractiveApp) container.bind(App, UnattendedApp)
from puppeter import container from puppeter.domain.gateway.answers import AnswersGateway from puppeter.domain.gateway.csr import CsrAttributesSetterGateway from puppeter.domain.gateway.fqdn import FqdnSetterGateway from puppeter.domain.gateway.script import ScriptPostProcessor, ScriptLibrariesConfigurer from puppeter.persistence.gateway.answers import YamlAnswersGateway from puppeter.persistence.gateway.csr import CsrAttributesSetterGatewayImpl from puppeter.persistence.gateway.fqdn import FqdnSetterGatewayImpl from puppeter.persistence.gateway.script import BashScriptPostProcessor, BashScriptLibrariesConfigurer container.bind(AnswersGateway, YamlAnswersGateway) container.bind(FqdnSetterGateway, FqdnSetterGatewayImpl) container.bind(ScriptPostProcessor, BashScriptPostProcessor) container.bind(ScriptLibrariesConfigurer, BashScriptLibrariesConfigurer) container.bind(CsrAttributesSetterGateway, CsrAttributesSetterGatewayImpl)
from puppeter import container from puppeter.domain.model.installer import Collection4xInstaller,\ Collection3xInstaller,\ Collection5xInstaller,\ Installer,\ RubygemsInstaller, \ SystemInstaller # TODO: implement GEM installer - https://github.com/coi-gov-pl/puppeter/issues/18 # container.bind(Installer, RubygemsInstaller) container.bind(Installer, SystemInstaller) container.bind(Installer, Collection3xInstaller) container.bind(Installer, Collection4xInstaller) container.bind(Installer, Collection5xInstaller)
from puppeter import container from puppeter.domain.model.configurer import CommandsCollector, Configurer from puppeter.domain.model.javafacts import JavaVersion from puppeter.persistence.service.commandscollector import CommandsCollectorImpl from puppeter.persistence.service.java import calculate_java_version from puppeter.persistence.service.os import calculate_operatingsystem, \ calculate_osfamily, calculate_osrelease, calculate_oscodename, calculate_docker from puppeter.domain.facter import Facter from puppeter.domain.model.osfacts import OperatingSystem, OsFamily, \ OperatingSystemRelease, OperatingSystemCodename, Docker from puppeter.persistence.service.puppetconf import PuppetConfConfigurer from puppeter.persistence.service.puppetserver import PuppetServerServiceStarterConfigurer, \ PuppetServerJvmArgsConfigurer Facter.set(OperatingSystem, calculate_operatingsystem) Facter.set(OsFamily, calculate_osfamily) Facter.set(OperatingSystemRelease, calculate_osrelease) Facter.set(OperatingSystemCodename, calculate_oscodename) Facter.set(Docker, calculate_docker) Facter.set(JavaVersion, calculate_java_version) container.bind(CommandsCollector, CommandsCollectorImpl) container.bind(Configurer, PuppetServerServiceStarterConfigurer) container.bind(Configurer, PuppetServerJvmArgsConfigurer) container.bind(Configurer, PuppetConfConfigurer)
from puppeter import container from puppeter.container import Named from puppeter.domain.model.configurer import Configurer from puppeter.domain.gateway.installer import InstallerGateway from puppeter.persistence.gateway.installer.debian.pc3x import DebianPC3xConfigurer from puppeter.persistence.gateway.installer.debian.pc4x import DebianPC4xConfigurer from puppeter.persistence.gateway.installer.debian.pc5x import DebianPC5xConfigurer from puppeter.persistence.gateway.installer.debian.system import DebianSystemConfigurer from puppeter.persistence.gateway.installer.linux import LinuxInstallerGateway @Named('debian') class DebianInstallerGateway(LinuxInstallerGateway): def _provide_install_configurers(self, installer): return tuple([self.__provide_install_configurer(installer)]) @staticmethod def __provide_install_configurer(installer): name = installer.bean_name() if name == 'gem': return container.get_named(Configurer, 'gem', installer=installer) name += '-debian' return container.get_named(Configurer, name, installer=installer) container.bind(InstallerGateway, DebianInstallerGateway) container.bind(Configurer, DebianPC3xConfigurer) container.bind(Configurer, DebianPC4xConfigurer) container.bind(Configurer, DebianPC5xConfigurer) container.bind(Configurer, DebianSystemConfigurer)
def setup_class(cls): cls.old_container = container.app_container container.app_container = Container() container.bind(App, InteractiveTestApp) container.bind(App, UnattendedTestApp)
from puppeter import container from puppeter.domain.model.configurer import Configurer from puppeter.persistence.gateway.installer.linux import RubyGemConfigurer container.bind(Configurer, RubyGemConfigurer)
from puppeter.container import Named from puppeter.domain.model.configurer import Configurer from puppeter.domain.gateway.installer import InstallerGateway from puppeter.persistence.gateway.installer.linux import LinuxInstallerGateway from puppeter.persistence.gateway.installer.redhat.pc3x import RedHatPC3xConfigurer from puppeter.persistence.gateway.installer.redhat.pc4x import RedHatPC4xConfigurer from puppeter.persistence.gateway.installer.redhat.pc5x import RedHatPC5xConfigurer from puppeter.persistence.gateway.installer.redhat.system import RedHatSystemConfigurer @Named('redhat') class RedHatInstallerGateway(LinuxInstallerGateway): def _provide_install_configurers(self, installer): configurers = [self.__provide_install_configurer(installer)] return tuple(configurers) @staticmethod def __provide_install_configurer(installer): name = installer.bean_name() if name == 'gem': return container.get_named(Configurer, 'gem', installer=installer) name += '-redhat' return container.get_named(Configurer, name, installer=installer) container.bind(InstallerGateway, RedHatInstallerGateway) container.bind(Configurer, RedHatSystemConfigurer) container.bind(Configurer, RedHatPC3xConfigurer) container.bind(Configurer, RedHatPC4xConfigurer) container.bind(Configurer, RedHatPC5xConfigurer)