
    -_g                     &    d dl mZ  G d de      Zy)    )
SoSPrepperc                       e Zd ZdZdZd Zy)HostnamePrepperaw  
    Prepper for providing domain and hostname information to the hostname
    mapping.

    The items from hostname sources are handled manually via the _get_items
    method, rather than passing the file directly, as the parser does not know
    what hostnames or domains to match on initially.

    This will also populate the regex_items list with local short names.
    hostnamec                 ~   g }d}|j                   rd}n|j                  rd}|j                  |      }|r|dk7  r|j                  d      }t	        |      dkD  r5|j                  |d          | j                  d   j                  |d          t	        |      dkD  r3dj                  |d	d        }|j                  |j                                |j                  |j                                |j                  d
      }|j                         D ]  }|j                  d      sd|v r|j                         dd  }	|	D ]O  }
t	        |
j                  d            dk(  r| j                  d   j                  |
       ?|j                  |
       Q  | j                  j                  D ]  }|j                  |        |S )Nr   zsos_commands/host/hostnamez"data/insights_commands/hostname_-f	localhost.   r      z	etc/hosts#)is_sosis_insightsget_file_contentsplitlenappendregex_itemsaddjoinstrip
splitlines
startswithoptsdomains)selfarchiveitems_filecontentr   
top_domain_hostslinehostlnhostdomains               ?/usr/lib/python3/dist-packages/sos/cleaner/preppers/hostname.py_get_items_for_hostnamez'HostnamePrepper._get_items_for_hostname   s   >>0E  8E**51w+-mmC(G7|aWQZ(  ,00'!*>7|a !XXgbcl3
Z--/0LL)))+6%%' 	'Ds#{d':ZZ\!"%F 'tzz#'1,$$Z044T:LL&	'		' ii'' 	!FLL 	!     N)__name__
__module____qualname____doc__namer(    r)   r'   r   r      s    	 D#r)   r   N)sos.cleaner.preppersr   r   r/   r)   r'   <module>r1      s    ,1j 1r)   