JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr O6uf'ddlZddlZddlZddlmZmZmZmZmZddl m Z GddeZ Gdde eeZ Gdd e eZ y) N)Plugin RedHatPlugin DebianPlugin UbuntuPlugin PluginOpt) RHELPolicyc*eZdZdZdZdZdZdZdZdZ y) PythonznCaptures information on the installed python runtime(s), as well as python modules installed via pip. zPython runtimepython)system)r z python -Vc|j|jd|jd}|ddk(r0|djddD]}|j|dyy) Nzpython-version)suggest_filenamezwhereis pip -bstatusroutputz list installed)add_cmd_outputpython_versionexec_cmdsplit)selfpipspips ;/usr/lib/python3/dist-packages/sos/report/plugins/python.pysetupz Python.setup!s}    2B  }}-. >Q H~++-ab1 =##se?$;< = N) __name__ __module__ __qualname____doc__ short_desc plugin_nameprofilespackagesrrrrr r s'"JKHH N =rr ceZdZdZdZy) UbuntuPython python3 -V)python3N)rrrrr#r$rrr&r&.s !NHrr&cJeZdZdZdZedddgZfdZdZd Z xZ S) 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. )r python36python2r(zplatform-pythonhashesFz#collect hashes for all python files)defaultdescc|jddgt|jtr$|jj dk(rd|_t |y)Nz python2 -Vr'z/usr/libexec/platform-python -V)r isinstancepolicyr dist_versionrsuperr)r __class__s rrzRedHatPython.setupAsJ \<89 dkk: . ((*a/"CD   rc|jdrO|jd5}|jtj|j ddddyy#1swYyxYw)Nr-z digests.json)indent) get_optioncollection_filewritejsondumps get_hashes)rhfiles rcollectzRedHatPython.collectHs` ??8 $%%n5 E DJJt'8CD E E % E Es 5A""A+c Ddgi}gd}|D]}tj|j|D]\}}}|D]}|jds|j||} t |d5} t j } | jd} | r%| j| | jd} | r%| j} |dj|| dddd|S#1swYxYw#t$r|jd|YwxYw) z! Get the hashes for Python files digests)z/usr/libz /usr/lib64z/usr/local/libz/usr/local/lib64z.pyrbi)filepathsha256NzUnable to read python file at ) oswalk path_joinendswithopenhashlibrFreadupdate hexdigestappendIOError _log_error) rrCpy_pathspy_pathroot_files_filerEfiledigestdatas rr?zRedHatPython.get_hashesMs< r    7G"$''$..*A"B 7a"7E >>%0 #~~dE:H7!(D1 T%,^^%5F#'99T?D"& & d 3'+yy#'&,%5%5%7F#I.55,4*07  7 7 7,  #7(H+3*)677s1# C?/A C3 <'C3 #C?3C< 8C??D D ) rrrrr#r option_listrrAr? __classcell__)r6s@rr*r*4s6 OH(E< >K E "rr*)rLr=rGsos.report.pluginsrrrrrsos.policies.distros.redhatrr r&r*r$rrr`sG 992=V=66< ;6<;r