Ejemplo n.º 1
0
 def __init__(self):
     super(SoftwareProfileManager, self).__init__()
     self._sp_db_api = SoftwareProfileDbApi()
     self._node_db_api = NodeDbApi()
     self._component_db_api = ComponentDbApi()
     self._global_param_db_api = GlobalParameterDbApi()
     self._kit_db_api = KitDbApi()
     self._config_manager = ConfigManager()
Ejemplo n.º 2
0
    def __init__(self):
        super(HardwareProfileManager, self).__init__()

        self._hpDbApi = HardwareProfileDbApi()
        self._spDbApi = SoftwareProfileDbApi()
        self._networkDbApi = NetworkDbApi()
        self._globalParameterDbApi = GlobalParameterDbApi()
        self._nodeDbApi = NodeDbApi()
Ejemplo n.º 3
0
    def __init__(self):
        super(HardwareProfileManager, self).__init__()

        self._hpDbApi = HardwareProfileDbApi()
        self._spDbApi = SoftwareProfileDbApi()
        self._networkDbApi = NetworkDbApi()
        self._globalParameterDbApi = GlobalParameterDbApi()
        self._nodeDbApi = NodeDbApi()
        self._logger = logging.getLogger(HARDWARE_PROFILE_NAMESPACE)
Ejemplo n.º 4
0
 def __init__(self):
     super(SoftwareProfileManager, self).__init__()
     self._sp_db_api = SoftwareProfileDbApi()
     self._node_db_api = NodeDbApi()
     self._component_db_api = ComponentDbApi()
     self._global_param_db_api = GlobalParameterDbApi()
     self._kit_db_api = KitDbApi()
     self._config_manager = ConfigManager()
     self._logger = logging.getLogger(SOFTWARE_PROFILE_NAMESPACE)
Ejemplo n.º 5
0
    def _get_global_parameter(key, default=None):
        """
        Get parameter from the DB.

        :param key: String
        :param default: String
        :returns: DbObject
        """
        try:
            return GlobalParameterDbApi().getParameter(key).getValue()
        except ParameterNotFound:
            return default
Ejemplo n.º 6
0
    def action_configure(self, _, *args, **kwargs):
        """
        Configure.

        :param _: Unused
        :param *args: Unused
        :param **kwargs: Unused
        :returns: None
        """

        try:
            result = GlobalParameterDbApi().getParameter(
                self.session,
                'DHCPLeaseTime'
            )

            dhcp_lease_time = int(result.getValue())
        except ParameterNotFound:
            dhcp_lease_time = 2400

        try:
            result = GlobalParameterDbApi().getParameter(
                self.session,
                'DNSZone')

            dns_zone = result.getValue()
        except ParameterNotFound:
            dns_zone = ''

        installer_node = NodeApi().getInstallerNode(self.session)

        self._manager.configure(
            dhcp_lease_time,
            dns_zone,
            self._get_provisioning_nics_ip(installer_node),
            self._dhcp_subnets(),
            installerNode=installer_node,
            bUpdateSysconfig=kwargs.get('bUpdateSysconfig', True),
            kit_settings=self._get_kit_settings_dictionary
        )
Ejemplo n.º 7
0
    def configure(self):
        fp = open(CONFIG_FILE, 'w')

        session = self.session

        try:
            print("# ", file=fp)
            print("# Dynamically generated by: genconfig (Do not edit!)",
                  file=fp)
            print("#", file=fp)
            print("", file=fp)

            try:
                result = GlobalParameterDbApi().getParameter(
                    self.session, 'DNSZone'
                )

                dnszone = result.getValue()
            except ParameterNotFound:
                dnszone = ''

            for db_nic in session.query(Nic).order_by(Nic.ip).all():
                if db_nic.node.state == 'Deleted':
                    continue

                if not db_nic.ip:
                    continue

                name = db_nic.node.name.split('.')[0]

                print('Host {}'.format(db_nic.ip), file=fp)
                print('\tStrictHostKeyChecking no', file=fp)

                print('Host {}.{}'.format(name, dnszone), file=fp)
                print('\tStrictHostKeyChecking no', file=fp)

                print('Host {}'.format(name), file=fp)
                print('\tStrictHostKeyChecking no', file=fp)

                print("", file=fp)

            print('Host *', file=fp)
            print('\t# ssh_config defaults', file=fp)
            print('\tGSSAPIAuthentication yes', file=fp)
            print('\tForwardX11Trusted yes', file=fp)
            print('\t# tortuga defaults', file=fp)
            print('\tNoHostAuthenticationForLocalhost yes', file=fp)
            print('\tStrictHostKeyChecking no', file=fp)

        finally:
            fp.close()
Ejemplo n.º 8
0
    def __init__(self, osFamilyInfo):
        super(OSSupport, self).__init__(osFamilyInfo)

        self._cm = ConfigManager()
        self._globalParameterDbApi = GlobalParameterDbApi()

        try:
            depot_dir = \
                self._globalParameterDbApi.getParameter('depot').getValue()
        except ParameterNotFound:
            # Fallback to legacy default
            depot_dir = '/depot'

        self._cm.setDepotDir(depot_dir)
Ejemplo n.º 9
0
    def __init__(self):
        TortugaDbApi.__init__(self)

        self._nodesDbHandler = NodesDbHandler()
        self._globalParameterDbApi = GlobalParameterDbApi()
Ejemplo n.º 10
0
    def __init__(self):
        super(ParameterManager, self).__init__()

        self._globalParameterDbApi = GlobalParameterDbApi()
Ejemplo n.º 11
0
 def __init__(self):
     self._global_param_db_api = GlobalParameterDbApi()
     super().__init__()
Ejemplo n.º 12
0
    def __init__(self, osFamilyInfo: OsFamilyInfo):
        super().__init__(osFamilyInfo)

        self._globalParameterDbApi = GlobalParameterDbApi()