+
    Û1j*  ã                   óŽ   € ^ RI t ^ RIt^ RIt^ RIHtHtHtHtHt ^ RI	H
t
  ! R R]4      t ! R R]]]4      t ! R R	]]4      tR# )
é    N)ÚPluginÚRedHatPluginÚDebianPluginÚUbuntuPluginÚ	PluginOpt)Ú
RHELPolicyc                   ó>   a € ] tR t^t o RtRtRtRtR	tRt	R t
RtV tR# )
ÚPythonzfCaptures information on the installed python runtime(s), as well as
python modules installed via pip.
zPython runtimeÚpythonz	python -Vc                óô   € V P                  V P                  R R7       V P                  R4      pVR,          ^ 8X  d<   VR,          P                  4       R,           F  pV P                  V R24       K  	  R# R# )zpython-version)Úsuggest_filenamezwhereis pip -bÚstatusÚoutput:é   NNz -v list installedN)Úadd_cmd_outputÚpython_versionÚexec_cmdÚsplit)ÚselfÚpipsÚpips   &  Ú;/usr/lib/python3/dist-packages/sos/report/plugins/python.pyÚsetupÚPython.setup!   sz   € Ø×ÑØ×ÑÐ2Bð 	ô 	
ð �}‰}Ð-Ó.ˆØ��>˜QÔð ˜H•~×+Ñ+Ó-¨b×1Ð1�Ø×#Ñ# s eÐ+=Ð$>Ö?ó 2ñ	 ó    © N)Úsystem)r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú
short_descÚplugin_nameÚprofilesÚpackagesr   r   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r
   r
      s1   ø‡ € ñð "€Jà€KØ€Hà€Hà €N÷
@ð 
@r   r
   c                   ó   € ] tR t^.tRtRtRtR# )ÚUbuntuPythonú
python3 -Vr   N)Úpython3)r   r   r    r!   r   r&   r'   r   r   r   r+   r+   .   s   † à!€NØ„Hr   r+   c                   ó^   a a€ ] tR t^4t oRtR
t]! RRRR7      .tV 3R ltR t	R t
R	tVtV ;t# )ÚRedHatPythona  In addition to the base information, on Red Hat family distributions the
python plugin also supports the 'hashes' option. If enabled, this plugin
will generate a json-formatted listing of all pyfiles within the
distribution-standard python package installation locations.
ÚhashesFz#collect hashes for all python files)ÚdefaultÚdescc                óÖ   <€ V P                  R R.4       \        V P                  \        4      '       d'   V P                  P	                  4       ^8X  d   RV n        \        SV `  4        R# )z
python2 -Vr,   z/usr/libexec/platform-python -VN)r   Ú
isinstanceÚpolicyr   Údist_versionr   Úsuperr   )r   Ú	__class__s   &€r   r   ÚRedHatPython.setupA   sM   ø€ Ø×Ñ˜\¨<Ð8Ô9Ü�d—k‘k¤:×.Ò.Ø—‘×(Ñ(Ó*¨aÔ/Ø"CˆDÔÜ‰‰Žr   c           	     ó  € V P                  R 4      '       dZ   V P                  R4      ;_uu_ 4       pVP                  \        P                  ! V P                  4       ^R7      4       RRR4       R# R#   + '       g   i     R# ; i)r0   zdigests.json)ÚindentN)Ú
get_optionÚcollection_fileÚwriteÚjsonÚdumpsÚ
get_hashes)r   Úhfiles   & r   ÚcollectÚRedHatPython.collectH   sY   € Ø�?‰?˜8×$Ò$Ø×%Ñ% n×5Ô5¸Ø—‘œDŸJšJ t§¡Ó'8ÀÔCÔD÷ 6Ñ5ñ %ß5×5Ð5ús   ±6A3Á3B	c                óž  € R. /p. R	OpV EF  p\         P                  ! V P                  V4      4       FÕ  w  rEpV FÉ  pVP                  R4      '       g   K  V P                  WG4      p \	        VR4      ;_uu_ 4       p	\
        P                  ! 4       p
V	P                  R4      pV'       d%   V
P                  V4       V	P                  R4      pK,  V
P                  4       p
VR,          P                  RVRV
/4       RRR4       KË  	  K×  	  EK  	  V#   + '       g   i     Ké  ; i  \         d    T P                  RT 24        EK  i ; i)
z Get the hashes for Python files Údigestsz.pyÚrbi   ÚfilepathÚsha256NzUnable to read python file at )z/usr/libz
/usr/lib64z/usr/local/libz/usr/local/lib64)ÚosÚwalkÚ	path_joinÚendswithÚopenÚhashlibrI   ÚreadÚupdateÚ	hexdigestÚappendÚIOErrorÚ
_log_error)r   rF   Úpy_pathsÚpy_pathÚrootÚ_ÚfilesÚ_filerH   ÚfileÚdigestÚdatas   &           r   rA   ÚRedHatPython.get_hashesM   s0  € ð �rð
ˆò
ˆô  ˆGÜ"$§'¢'¨$¯.©.¸Ó*AÖ"B‘�˜Û"�EØ Ÿ>™>¨%×0Ò0Ù Ø#Ÿ~™~¨dÓ:�Hð7Ü! (¨D×1Ô1°TÜ%,§^¢^Ó%5˜FØ#'§9¡9¨T£?˜Dß"&Ø &§¡¨dÔ 3Ø'+§y¡y°£¢à%+×%5Ñ%5Ó%7˜FØ# IÕ.×5Ñ5Ø *¨HØ (¨&ð7ô ÷ 2Ñ1ó #ô #Cñ  ð, ˆ÷ 2×1Ð1ûô #ô 7ØŸ™Ð(HØ+3¨*ð)6÷ 7ð 7ð7ús7   Á*D(Á>.DÂ-ADÃ=D(ÄD%ÄD(Ä%D(Ä(E	ÅE	)r   )r   Úpython36Úpython2r-   zplatform-python)r   r   r    r!   r"   r&   r   Úoption_listr   rC   rA   r'   r(   Ú__classcell__)r8   r)   s   @@r   r/   r/   4   s=   ù‡ € ñð O€Há�( EØ<ô	>ð€Kõ
òE÷
"ò "r   r/   )rO   r?   rJ   Úsos.report.pluginsr   r   r   r   r   Úsos.policies.distros.redhatr   r
   r+   r/   r   r   r   Ú<module>rf      sI   ðó Û Û 	÷9õ 9å 2ô@ˆVô @ô6�6˜<¨ô ô;�6˜<ö ;r   