Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/sos/cleaner/parsers/__pycache__/ |
Upload File : |
o -�_gn � @ s@ d dl Z d dlmZ d dlmZ dZdZdZG dd� de�ZdS ) � N)�SoSCleanerParser)� SoSMacMapze((?<!([0-9a-fA-F\'\"]:)|::)([^:|-])?([0-9a-fA-F]{2}(:|-)){7}[0-9a-fA-F]{2}(\'|\")?(\/|\,|\-|\.|\s|$))ze((?<!([0-9a-fA-F\'\"]:)|::)(([^:\-]?[0-9a-fA-F]{4}(:|-)){3}[0-9a-fA-F]{4}(\'|\")?(\/|\,|\-|\.|\s|$)))zW((?<!([0-9a-fA-F\'\"]:)|::)(([^:\-])?(([0-9a-fA-F]{2}([:\-\_])){5,6}([0-9a-fA-F]{2}))))c sT e Zd ZdZdZeeegZdZ dgZ dZdZg f� fdd� Z d d � Zdd� Z� ZS ) �SoSMacParserz!Handles parsing for MAC addressesz MAC Parser)z53:4f:53z534f:53zsos_commands/.*/modinfo.*�mac_mapFc s t � | _t� �||� d S )N)r �mapping�super�__init__)�self�config�skip_cleaning_files�� __class__� �@/usr/lib/python3/dist-packages/sos/cleaner/parsers/mac_parser.pyr 5 s zSoSMacParser.__init__c C sP |d dvr|dd� }|d dvs|d dvr$|dd� }|d dvs|� � S )z�Strips away leading and trailing non-alphanum characters from any matched string to leave us with just the bare MAC addr r �0123456789abcdefABCDEF� N���)�strip)r �matchr r r �reduce_mac_match9 s ��zSoSMacParser.reduce_mac_matchc C s| d}| j D ]4}dd� t�||tj�D �}|r9|t|�7 }|D ]}| �|�}|�| j�r,q| j� |�}|� ||�}qq||fS )Nr c S s g | ]}|d �qS )r r )�.0�mr r r � <listcomp>G s z,SoSMacParser._parse_line.<locals>.<listcomp>)�regex_patterns�re�findall�I�lenr � startswith�obfuscated_patternsr �get�replace)r �line�count�pattern�matchesr �stripped_match� new_matchr r r �_parse_lineD s �zSoSMacParser._parse_line)�__name__� __module__�__qualname__�__doc__�name� IPV6_REG_8HEX� IPV6_REG_4HEX�IPV4_REGr r �parser_skip_files�map_file_key�compile_regexesr r r( � __classcell__r r r r r "