3 ܓi@s ddlmZGdddeZdS)) SoSPrepperc@seZdZdZdZddZdS)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 CsFg}d}|jrd}n |jrd}|j|}|r|dkr|jd}t|dkrl|j|d|jdj|dt|dkrdj|d d}|j|j |j|j |jd }xr|j D]f}|j d sd|krq|jdd} x<| D]4} t| jddkr|jdj| q|j| qWqWx|j j D]} |j| q.W|S) Nrzsos_commands/host/hostname_-fz"data/insights_commands/hostname_-fZ localhost.rz etc/hosts#)Zis_sosZ is_insightsZget_file_contentsplitlenappendZ regex_itemsaddjoinstrip splitlines startswithZoptsdomains) selfarchiveitemsZ_fileZcontentrZ top_domainZ_hostslineZhostlnhostZdomainr/usr/lib/python3.6/hostname.py_get_items_for_hostnames8       z'HostnamePrepper._get_items_for_hostnameN)__name__ __module__ __qualname____doc__namerrrrrrs rN)Zsos.cleaner.preppersrrrrrr s