示例#1
0
def parse_system_live_command(command, command_raw_output, parsed_map):
    # Parse live cmd output and create imap
    imap = {}
    cinfo_parser.extract_section_from_live_cmd(command, command_raw_output, imap)
    sectionlist = []
    sectionlist.append(command)
    parse_sys_section(sectionlist, imap, parsed_map)
示例#2
0
def parse_system_info_all(cinfo_path, parsed_map, ignore_exception=False):
    # Parse collectinfo and create intermediate section_map
    imap = {}
    cinfo_parser.extract_validate_filter_section_from_file(cinfo_path, imap, ignore_exception)
    section_filter_list = _get_section_list_for_parsing(imap, SYS_SECTION_NAME_LIST)

    logger.info("Parsing sections: " + str(section_filter_list))
    parse_sys_section(section_filter_list, imap, parsed_map)
示例#3
0
def parse_system_live_command(command, command_raw_output, parsed_map):
    # Parse live cmd output and create imap
    imap = {}
    cinfo_parser.extract_section_from_live_cmd(command, command_raw_output,
                                               imap)
    sectionlist = []
    sectionlist.append(command)
    parse_sys_section(sectionlist, imap, parsed_map)
示例#4
0
def parse_system_info_section(cinfo_path,
                              parsed_map,
                              sectionlist,
                              ignore_exception=False):
    # Parse collectinfo and create intermediate section_map
    imap = {}
    cinfo_parser.extract_validate_filter_section_from_file(
        cinfo_path, imap, ignore_exception)

    parse_sys_section(sectionlist, imap, parsed_map)
示例#5
0
def parse_system_info_all(cinfo_path, parsed_map, ignore_exception=False):
    # Parse collectinfo and create intermediate section_map
    imap = {}
    cinfo_parser.extract_validate_filter_section_from_file(
        cinfo_path, imap, ignore_exception)
    section_filter_list = _get_section_list_for_parsing(
        imap, SYS_SECTION_NAME_LIST)

    logger.info("Parsing sections: " + str(section_filter_list))
    parse_sys_section(section_filter_list, imap, parsed_map)
示例#6
0
def _get_sys_map(imap, ignore_exception):
    """
    Extract System information from imap

    """

    sys_map = {}
    sys_section_list = _get_section_list_for_parsing(imap, SYS_SECTION_NAME_LIST)

    try:
        parse_sys_section(sys_section_list, imap, sys_map)

    except Exception as e:

        if not ignore_exception:
            logger.error("sys_section_parser can not parse intermediate json. Err: " + str(e))
            raise

    return sys_map
示例#7
0
def _get_sys_map(imap, ignore_exception):
    """
    Extract System information from imap

    """

    sys_map = {}
    sys_section_list = _get_section_list_for_parsing(imap,
                                                     SYS_SECTION_NAME_LIST)

    try:
        parse_sys_section(sys_section_list, imap, sys_map)

    except Exception as e:

        if not ignore_exception:
            logger.error(
                "sys_section_parser can not parse intermediate json. Err: " +
                str(e))
            raise

    return sys_map
示例#8
0
def parse_system_info_section(cinfo_path, parsed_map, sectionlist, ignore_exception=False):
    # Parse collectinfo and create intermediate section_map
    imap = {}
    cinfo_parser.extract_validate_filter_section_from_file(cinfo_path, imap, ignore_exception)

    parse_sys_section(sectionlist, imap, parsed_map)