예제 #1
0
    def _get_pf_doc(self, pf_path, sys_name, shell):
        '@types: str, str, Shell -> File, File, InitDocument'
        base_path = sap_discoverer.findSystemBasePath(pf_path, sys_name)

        get_def_pf_fn = Fn(discover_default_pf, shell, pf_path, sys_name)
        get_inst_pf_fn = Fn(sap_discoverer_by_shell.read_pf, shell, pf_path)

        default_pf_result = self._get_or_discover(base_path, Sfn(get_def_pf_fn))
        default_pf_file, default_pf_doc = default_pf_result or (None, None)
        if not default_pf_file:
            logger.warn("Failed to get content for the DEFAULT.PFL")
        pf_file, pf_doc = self._get_or_discover(pf_path, Sfn(get_inst_pf_fn))
        if not pf_file:
            logger.warn("Failed to get content for the instance profile")
        doc = sap_discoverer.createPfsIniDoc(default_pf_doc, None, pf_doc)
        return default_pf_file, pf_file, doc
    def _get_pf_doc(self, pf_path, sys_name, shell):
        '@types: str, str, Shell -> File, File, InitDocument'
        base_path = sap_discoverer.findSystemBasePath(pf_path, sys_name)

        get_def_pf_fn = Fn(discover_default_pf, shell, pf_path, sys_name)
        get_inst_pf_fn = Fn(sap_discoverer_by_shell.read_pf, shell, pf_path)

        default_pf_result = self._get_or_discover(base_path, Sfn(get_def_pf_fn))
        default_pf_file, default_pf_doc = default_pf_result or (None, None)
        if not default_pf_file:
            logger.warn("Failed to get content for the DEFAULT.PFL")
        pf_file, pf_doc = self._get_or_discover(pf_path, Sfn(get_inst_pf_fn))
        if not pf_file:
            logger.warn("Failed to get content for the instance profile")
        doc = sap_discoverer.createPfsIniDoc(default_pf_doc, None, pf_doc)
        return default_pf_file, pf_file, doc
예제 #3
0
            logger.info("Trying to discover ASCS")
            vector.addAll(_discoverAscsInPf(defaultPfDoc, system, systemOsh, oshPerInstance))
        except SapSystemInconsistentDataException, e:
            logger.debugException('')
            raise e
        except:
            logger.warn("Failed to discover ASCS in the profile")
            logger.debugException('')

    #Making database reporting optional depending on global configuration according to QCCR1H100374 Keep a possibility option to discover SAP related database via Host Applications job
    do_report_database = GeneralSettingsConfigFile.getInstance().getPropertyStringValue('reportSapAppServerDatabase', 'false')
    if do_report_database and do_report_database.lower() == 'true':
        systemType = sap.SystemType.ABAP
        system_ = None
        for name, (startPfIniDoc, instPfIniDoc) in pfSetByInstName.iteritems():
            doc = createPfsIniDoc(defaultPfDoc, startPfIniDoc, instPfIniDoc)
            system_ = system_ or sap_discoverer.parse_system_in_pf(doc)
            try:
                vector.addAll(_discoverDbsInPfs(doc, sapUtils, systemOsh))
            except Exception, e:
                logger.warn("Failed to discover DB based for %s. %s" % (name, e))
            isDs = checkDoubleStack(doc)
            systemType = isDs and sap.SystemType.DS or systemType
    
        if system_:
            system_ = sap.System(system.getName(), globalHost=system.globalHost,
                                type_=systemType, defaultPfPath=first(defaultPf),
                                uuid_=system_.uuid)
            _updateSystemOsh(system_, systemOsh)
    return vector