idsddlZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZddlmZddlmZdd lmZdd lmZmZmZmZdd lmZeeeee d ZGd dZy)N)quote)load) InitSystem)JujuSSH)SSHControlPersist)LocalTransport) OCTransport)SaltStackMaster)CommandTimeoutExceptionConnectionExceptionUnsupportedHostExceptionInvalidTransportException) parse_version)localcontrol_persistoc saltstackjujuc`eZdZ d3dZedZdZdZdZedZ dZ d Z d Z d Z d4d Zed ZdZdZdZdZdZdZdZdZdZd4dZdZdZdZdZ d5dZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4y)6SosNodeNc|j|_||_|d|_|j |d|_|d|_|d|_|d|_d|_ d|_ d|_ d|_ i|_ i|_|xs|jj|_|jj"s1|jj$s|j |j_|r||j_d|_d|_d|_g|_dgggg|dd|_d |_t3j4d |_t3j4d |_|j;||_|j<j>r|j<j>d k7|_ |j<jA|j |jG|_ |j<j|_ |jr|jjHrd}|jJr|r|js|j<jMy|jr!|jOrd|j_(|jjPr|jS|jUyyy#tB$r}|jEd |zd}~wwxYw)N cmdlineoptstmpdirhostlen need_sudo sos_optionsFsos_cmd)versionenableddisabledoptionspresetsr sosreportsossos_uirootz!Unable to open remote session: %s)+stripaddresscommonsopts_assign_config_optsrrrrrhostclusterhostname sos_env_vars _env_varspassword _password nopasswd_sudosudo_pwsos_path retrievedhash_retrieved file_listsos_infosos_binlogging getLoggersoslogui_log_load_remote_transport _transport default_userconnect Exception log_errordetermine_host_policyno_local connected disconnectcheck_in_container containerizedcreate_sos_container_load_sos_info)selfr(r)r1 local_sudo load_factserrs 7/usr/lib/python3/dist-packages/sos/collector/sosnode.py__init__zSosNode.__init__*sd}}  M*    "h' y)  -"=1    !7TYY%7%7yy&&tyy/@/@ $DII   *DII  #y)   # ''. ''1 55g> ?? ' '!__99VCDN  OO # #DNN 3..0 00 ::$)),,J >>j99**,zz**,.3DII+yy&&))+    !)>  NN>D E  s5%K K,K''K,cH|jr|jjSy)NT)r@rGrMs rQrGzSosNode.connectedls ????,, ,c8|jjy)zDWrapper to close the remote session via our transport agent N)r@rHrTs rQrHzSosNode.disconnectss ""$rUc|jdvrd|_t|j|S|jjt j vr-t |jj|j|S|jjdk7rG|jd|jjzt|jjt|j|S)zDetermine the type of remote transport to load for this node, then return an instantiated instance of that transport ) localhostz 127.0.0.1Tautoz6Connection failed: unknown or unsupported transport %s) r(rrr* transport TRANSPORTSkeysrDrr)rMr)s rQr?zSosNode._load_remote_transportxs <<5 5DJ!$,,8 8 YY JOO$5 5dii1124<<I I YY F * NNH))%%& ,DII,?,?@ @ w77rUcVdj|j|jdz|S)Nz {:<{}} : {})format _hostnamerrMmsgs rQ_fmt_msgzSosNode._fmt_msgs$##DNNDLL14DcJJrUc^|js|jr/tjj |_|jS|j d}|ddk(rB|dj dD]+}|s|j d}|d|j|d<-|jS)Nz env --nullstatusroutput=r^)r0rosenvironcopy run_commandsplit)rMretln_vals rQenv_varszSosNode.env_varss~~zz!#!2~~&&|4x=A%!(m11&9:!$!xx}26q'tAw/ : ~~rUc||_|jjd|j|jjd|jj|jjd|j d|jjdd|jjd|j jy) z>Set the manifest section that this node will write to r.policy sos_versionrfinal_sos_commandrZN)manifest add_fieldr`r,distror9r@name)rMrws rQset_node_manifestzSosNode.set_node_manifests!   DNN; $))*:*:;  t}}Y/GH  3R8  T__-A-ABrUctjjdr|jdytjj d|jdyy)zV Tries to identify if we are currently running in a container or not. z/run/.containerenvz/Found /run/.containerenv. Running in container.T containerz/Found env var 'container'. Running in containerF)ripathexists log_debugrjgetrTs rQrIzSosNode.check_in_containersK 77>>. / NNL M ::>>+ & 2 NNL MrUc|jjrH|jj|jj|j |jj }|j|d}|ddvr|ddk(r'NO' &&tyy'F'F'H15'7x=A%MM"B$(II$@$@#ABNN#O%(]$34#OG!$X /0G #rUcx|jjrQ|jjdj |jj|jj S|jjdj |jjxs|jjS)zrDetermine what the auth string should be to pull the image used to deploy our temporary container default) r* registry_userr,runtimesfmt_registry_credentialsregistry_passwordfmt_registry_authfileregistry_authfilecontainer_authfilerTs rQrzSosNode.get_container_auths 99 " "99%%i0II '' ++  99%%i0FF ++Ktyy/K/K rUc^ |jd|z|}|ddk(S#t$rYywxYw)z3Checks for the presence of fname on the remote nodezstat %srrerF)rlrC)rMfnamerrs rQ file_existszSosNode.file_existssB ""9u#4 "JCx=A% %  s  ,,cf|jrd|jvr |jS|jS)NrX)r.r(rTs rQr`zSosNode._hostnames( ==[ === ||rUc4d}tj|d|S)zUAttempts to obfuscate sensitive information in log messages such as passwordsz>(?P(pass|key|secret|PASS|KEY|SECRET).*?=)(?P.*?\s)z\g****** )resub)rMrbregs rQ_sanitize_log_msgzSosNode._sanitize_log_msgsPvvc,c22rUcX|jj|j|y)z:Format a ui message that includes host name and formattingN)r>inforcras rQui_msgzSosNode.ui_msgs s+,rUctjdd}d|jd|d|}|jj |y)z#Used to print and log info messagesr^[:] N)inspectstackr`r=rrMrbcallerlmsgs rQrzSosNode.log_infos9#A&#~~vs; rUctjdd}d|jd|d|}|jj |y)z$Used to print and log error messagesr^rrrrN)rrr`r=errorrs rQrDzSosNode.log_errors9#A&#~~vs; $rUc|j|}tjdd}d|jd|d|}|jj |y)z$Used to print and log debug messagesr^rrrrN)rrrr`r=debug)rMrbrs rQrzSosNode.log_debug sI$$S)#A&"nnfc: #rUcp|jjrdt|zS|jrd|zS|S)zIf we need to provide a sudo or root password to a command, then here we prefix the command with the correct bits zsu -c %sz sudo -S %s)r* become_rootrr)rMrs rQ _format_cmdzSosNode._format_cmds7 99 c * * >>#% % rUcVd}d}|jjZ|jjj|jj}|udj |d}|dr\|d}nV|j |jjdd}|ddk(r&|d jjd \}}}|r=t|jdd k(r|d z } |d |jddzz }||jd<|jdr"|jd|jdzn<|j|jj k(s|j#dd|_y|j'drd|_d|j(z}|j |dd}|ddk(r|j+|d |j'dr|j-yy#t$r}|jd|zYd}~d}~wwxYw)zLQueries the node for information about the installed version of sos N.rreleaseT use_containerrrerrf-.0-%sz%Unable to fully parse sos release: %szsos version is %sz!sos is not installed on this nodeFz4.0z sos reportz%s -l3.6)r,container_version_commandpackage_manager pkg_version sos_pkg_namejoinrlr'rmlenrCrr9rr(r*primaryrDrGcheck_sos_versionr:_load_sos_plugins_load_sos_presets) rMverrelpkgpkgs_rPrsosinfos rQrLzSosNode._load_sos_infos 99 . . 6))++77 8N8NOChhs9~.y>i.C##DII$G$G26$$HDH~""8n224::3? 3 399S>"a't  Nusyy~a000$' i == # MM- i0HH I<<499#4#44BC"DN  ! !% ('DL $""3dd"K 8  !  " "78#4 5  ! !% (  " " $ )- NFLMM Ns0H H( H##H(cLd|jz}|j|dd}|ddk(ry|djD]b}|jj ds#|j ddj}|j d j|dyy) Nz%s --list-presetsTrrerrfzname:r^r")r:rl splitlinesr' startswithrmr9append)rMrrlinepnames rQrzSosNode._load_sos_presetsOs!DLL0s$$G x=A H 002 ;::<**73 JJw/288:EMM),33E: ; rUcRd}d}d}d}d}|dz|z}|dz|z}|dz|z} |dzdz} |j|||jd<|j|||jd <|j| ||jd <|j| |d |jd <y) Nz,The following plugins are currently enabled:z-The following plugins are currently disabled:z4The following options are available for ALL plugins:z+The following plugin options are available:z Profiles:z(.*?)z rr r!Tprofiles)_regex_sos_helpr9) rMrENABLEDDISABLED ALL_OPTIONSOPTIONSPROFILES enableregdisregoptregproregs rQrzSosNode._load_sos_pluginsXs@BL ?g%0 G#k17"X-G#f,#'#7#7 7#K i $($8$8$I j!#'#7#7#H i $($8$8$$O j!rUcDg}tj||tjD]f}|jD]Q}|s$ |j |j d)|j d}|jd|DSh|S#t $rYcwxYw)Nr,c3^K|]%}|js|j'ywN)r').0ps rQ z*SosNode._regex_sos_help..tsAQqwwyqwwyAs--)rfindallSrrrmrCextend)rMregexris_listrresultrrs rQrzSosNode._regex_sos_helpisjj6 BF))+ B 4::<?3 3AJJA!AA B B %s"B BBc |jd|z|jj|S#t$r!}|j d|d|Yd}~yd}~wwxYw)z1Reads the specified file and returns the contentszReading file %szException while reading : Nrv)rr@ read_filerCrD)rMto_readrPs rQrzSosNode.read_filewsR  MM+g5 6??,,W5 5  NNwL M s.1 AAAc |jr:|jd|jdjz|jdSt i|j j td|jj|jd}|r |jd|jz|S|jdt)z[Attempts to identify the host installation against supported distributions zusing local policy %srsTz/etc/os-release)cachesysrootinit probe_runtime remote_exec remote_checkzloaded policy %s for hostz4Unable to determine host installation. Ignoring node) rrr)ryrr*rrr@rlrrDr )rMr,s rQrEzSosNode.determine_host_policys :: MM1 LL299: ;<<) )"dii&7&7jl"& $ ; ;!%0A!BD  MM5 C DK MN&&rUcfd}||} tjd}t|}||k\S#t$r}jd|zYd}~yd}~wwxYw)aChecks to see if the sos installation on the node is AT LEAST the given ver. This means that if the installed version is greater than ver, this will still return True :param ver: Version number we are trying to verify is installed :type ver: ``str`` :returns: True if installed version is at least ``ver``, else False :rtype: ``bool`` c8 |jdd}d}d|vr)d|jddjddz}t|jddk(r|dz }||zS#t$r#}jd|d ||cYd}~Sd}~wwxYw) NrrrvrrrzUnable to format 'z': )rmrrCr)r_fver_relrPrMs rQ_format_versionz2SosNode.check_sos_version.._format_versions  #q)#:3!3!9!9#!>q!AADu{{3'(A-TMEt|# c3GH  sA)A-- B6BBBrzError checking sos version: %sNF)rr9rCrD)rMrr_ver _node_ver _test_verrPs` rQrzSosNode.check_sos_versionsf s# %dmmI&>?I%d+I ) )  NN;cA B s'8 AAAcj|jsy|jjj|duS)z2Checks if a given package is installed on the nodeFN)r,r pkg_by_name)rMrs rQ is_installedzSosNode.is_installeds,yyyy((44S9EErUc4|js]|jsQ|jd |jj |j }|s|jdt  |r1|jjr|jj|}|r|j|}d|vrd}|r|j} | j|}|jj|||||S#t$r}|jd|zd}~wwxYw)aRuns a given cmd, either via the SSH session or locally Arguments: cmd - the full command to be run timeout - time in seconds to wait for the command to complete get_pty - If a shell is absolutely needed to run a command, set this to True need_root - if a command requires root privileges, setting this to True tells sos-collector to format the command with sudo or su - as appropriate and to input the password use_container - Run this command in a container *IF* the host is containerized z-Node is disconnected, attempting to reconnectzFailed to reconnect to nodez#Error while trying to reconnect: %sNatomicT)rGrrr@ reconnectr2r rCr,rJformat_container_commandrrqupdaterl) rMrtimeoutget_ptyrrenv reconnectedrP_cmd_envs rQrlzSosNode.run_commands~~djj NNJ K "oo77G "NN#@A--# TYY44))44S9C ""3'C s?G }}H//#&C**3C+24 4 DsJK s>C44 D=DDc |j}|r|j|n|jd|jr|j |_|jy#t $rYwxYw)z.Run an sos report on the node, then collect itz'Unable to determine path of sos archiveN)execute_sos_commandfinalize_sos_pathrDr5retrieve_sosreportr6rCcleanup)rMr~s rQr#zSosNode.sosreportsi ++-D&&t,HI}}!%!8!8!:    sAA)) A54A5c$||jdvS)z/Verifies if the given preset exists on the noder"r9)rMpresets rQ_preset_existszSosNode._preset_existsy111rUcdtfd|jd|jdfDS)z/Verifies if the given plugin exists on the nodec3&K|]}|v ywr)rsplugins rQrz)SosNode._plugin_exists..sE16Q;Err )anyr9rMrs `rQ_plugin_existszSosNode._plugin_existss;Ey)A)-z)B)DEE ErUc$||jdvS)z6Checks to see if the plugin is default enabled on noderrr"s rQ_check_enabledzSosNode._check_enabledrrUc$||jdvS)z7Checks to see if the plugin is default disabled on noder rr"s rQ_check_disabledzSosNode._check_disabledsz222rUc|jdd}|j|sy|j|r||jjvry|j |r||j dvSy)zAttempts to verify that the given option is available on the node. Note that we only get available options for enabled plugins, so if a plugin has been force-enabled we cannot validate if the plugin option is correct or notrrFr!T)rmr#r'r*enable_pluginsr%r9)rMoptplugs rQ_plugin_option_existszSosNode._plugin_option_existssq yy~a ""4(   &DII444   t $$-- 22 2rUc8djfd|DS)z^Returns a comma delimited list for sos plugins that are confirmed to exist on the noderc3FK|]}j|s|ywr)r#)rorMs rQrz,SosNode._fmt_sos_opt_list..sBa4+>+>q+ABs!!)r)rMr*s` rQ_fmt_sos_opt_listzSosNode._fmt_sos_opt_listsxxB4BBBrUc||_y)zVExpose the node to the cluster profile determined for the environment N)r-)rMr-s rQ set_clusterzSosNode.set_clusters  rUc|jjrP|js|jj|_n(|jd|jjz|jjrE|jjD],}||j vs|j j |.|jjrP|jjD]7|jvs|jj|j<9|jjrs|jjD]Ztfd|jDr"d|jj}|jj |\|jj|r;|jj5|jj|dddy|jj5|jj|dddy#1swYyxYw#1swYyxYw)a+This is used to modify the sos report command run on the nodes. By default, sos report is run without any options, using this will allow the profile to specify what plugins to run or not and what options to use. This will NOT override user supplied options. zYCluster specified preset %s but user has also defined a preset. Using user specification.c3&K|]}|v ywrr)rr/r*s rQrz2SosNode.update_cmd_from_cluster..:s;3!8;r rhN)r- sos_presetrr sos_pluginsr)rrsos_plugin_optionsr!plugoptscheck_node_is_primarylockset_primary_optionsset_node_options)rMr+optionr*s @rQupdate_cmd_from_clusterzSosNode.update_cmd_from_clusters << " ";;"ll55  L $ 7 789 << # # 00 5t222''..t4 5 << # #||// Jd...,0LL,D,DS,ID$$S) J << * *||66 1;T]];;(+(, (G(G(LNFMM((0  1 << - -d 3"" 7 006 7 7"" 4 --d3 4 4 7 7 4 4s#III Iclt|jj|_t|jj|_t|jj|_t|jj |_t|jj |_y)zFrom the global opts configuration, assign those values locally to this node so that they may be acted on individually. N)listr* only_plugins skip_pluginsr)r8rrTs rQr+zSosNode._assign_config_optsGsu !!7!78 !7!78"499#;#;<TYY//0 499++, rUc |jd}|j}|r|dt|d}g}|jdrS|jj dk7r:|j dtt|jj z|jdrP|jjr:|j dtt|jjz|jdr|jjr|j d |jjr|j d |jjr1|j d t|jjz|jd r|jjr@|j d tdj|jjz|jjr@|j dtdj|jjz|jdrP|jjr:|j dtt|jjz|jds|jdr|jj dk7r(|j d|jj z|jj"r(|j d|jj"z|jdre|jj$r(|j d|jj$|jj&r|j d|j)|j+dt,j.j|j0j2|j4}|j6D],}|j6|}|j d|d|r|nd.|j8r|j8Dcgc]J}|j;|j=ddr%|j?|j=ddr|L}}|r3|j d tdjd!|Dz|j@ra|jC|j@r(|j d"t|j@zn|jEd#|j@z|jFr$|jFDcgc]}|j;|s|}}tI|tI|jFk7r>tKtM|jFtM|z } |jEd$| z|jO|jF} | r|j d%t| z|ddj||_(|jSd&|jPz|jTjWd'|jPy(|jXr|jXDcgc]}|j[|s|} }tI| tI|jXk7r>tKtM|jXtM| z } |jEd)| z|jO| } | r|j d*t| z|j\r|j\Dcgc]4}||jXvr$|j_|r|j;|r|6}}tI|tI|j\k7r>tKtM|j\tM|z }|jEd+|z|jO|}|r|j d,t|z|ddj||_(|jSd&|jPz|jTjWd'|jPy(cc}wcc}wcc}wcc}w)-zZUse host facts and compare to the cluster type to modify the sos command if neededr rz --threads=%sz3.7z--plugin-timeout=%sz3.8z--allow-system-changesz --no-env-varsz --since=%sz4.1z--skip-commands=%srz--skip-files=%sz4.2z--cmd-timeout=%sz4.3z4.2-13rYz--container-runtime=%sz--namespaces=%sz4.5.2z--journal-size=z--low-priorityr#z--rvrrrhz-k %sc3 K|]}|ywrr)rr/s rQrz+SosNode.finalize_sos_cmd..s8Iq8Is z --preset=%sz?Requested to enable preset %s but preset does not exist on nodezBRequested plugins %s were requested to be enabled but do not existz--only-plugins=%szFinal sos command set to %sruNzARequested to skip plugins %s, but plugins are already not enabledz--skip-plugins=%szORequested to enable plugins %s, but plugins are already enabled or do not existz--enable-plugins=%s)0r9determine_sos_labelrrr*threadsrstrplugin_timeoutallow_system_changes no_env_varssince skip_commandsr skip_files cmd_timeoutcontainer_runtime namespaces journal_size low_priorityr>replacerir~r, sos_bin_pathr:rr8r#rmr,rrrrArr@setr0rrrwrxrBr%r)r')rMrlabelsos_optsr*rpr/r*plugsnot_onlyonlyskipnot_skipskiplnnot_onenables rQfinalize_sos_cmdzSosNode.finalize_sos_cmdRs-- *((* ")5<8G  ! !% (yy  A%s499;L;L7M1N NO  ! !% (yy'' 5"'DII,D,D(E"F!GH  ! !% (yy-- 89yy$$0yy uTYY__/E EF  ! !% (yy&&(chhtyy'>'>?@Byy##%sxx 8L8L/M)NO  ! !% (yy$$ 2"'DII,A,A(B"C!DE  ! !% (D,B,B8,Lyy**f4,tyy/J/JJyy##% (<(<<  ! !' *yy%%/$))2H2H1I JKyy%% 01 $$&//  GGLL// >  ## ?C##C(D OObQtt&<= > ? ==#}}E!**1773<?;221773<?CEDE%8ID8I0I*J JK ;;""4;;/ dkk0B BC 359[[ AB    $ 1 1L1T5H5H5KQLEL5zS!2!233D$5$5 6U CD :  3dllBC  3T\\BkEMLLs%Ab6b;-b;cc 9ccd}||jj|z }|jjr7||sd|jjznd|jjzz }|sy|j d|z|j drd}n%d}|j jd d d |}|d |S) z?Determine what, if any, label should be added to the sos reportrvz%srNzLabel for sos report set to %srz--labelz--namerrrrh)r-get_node_labelr*rXrrr(rm)rMrXlcmds rQrGzSosNode.determine_sos_labels ,,T22 99?? EdTYY__, 499??2 4E 7%?@  ! !% (DD#||11#6q95AE&&rUc2|jj}|r|j|d}|jd}|j d|z||_|jdd|_|jjd|j y)z\Use host facts to determine if we need to change the sos path we are retrieving fromrvrzFinal sos path: %s/rcollected_archiveN) r,sos_path_striprUrmrr5archiverwrx)rMr~pstrips rQrzSosNode.finalize_sos_paths{)) <<+Dzz|A *T12 zz#r*   3T\\BrUc||dk(ry|dk(rd|vry|dk(ryt|dkDr|jd ddSd |zS) Nrz+sos report process received SIGKILL on noder^sudozsudo attempt failedz4sos report terminated unexpectedly. Check disk spacer zsos exited with code %s)rrm)rMrcstdouts rQdetermine_sos_errorzSosNode.determine_sos_errorsT 8@ 7, 9I v;?<<%a* *,r1 1rUc\|jd d}d}|j|j|jjddd|j }|ddk(r;|dj D]s}tj|dr|j}|jd r|jd d }O|jd sa|jd }u|r|jjd|t|dk(r|jjdd|St|dk(r|jjdd|S|jjdd|S|jjdd|S|j|d|d}|jd|dd|dt!|#t"$r|j%dt $r.}|j'd||jd|d}~wwxYw)z2Run sos report and capture the resulting file pathzGenerating sos report...FT)r r rrrrerrfz*sosreport-*tar*)z sha256 z md5  r^zThe checksum is: rchecksum checksum_typemd5@sha256unknownzError running sos report. rc = z msg = zTimeout exceededz'Exception during sos report execution: zError running sos report: N)rrlrr*r r/rfnmatchr'rrmrwrxrrrrrCr rDr)rMr~rurrrPs rQrzSosNode.execute_sos_commands ./' DH""4<<+/99+<+<+/415'+'8'8 #:C 8}!M4463Dt-?@#zz|'>?#'::d#3A#6)<=#'::<? 3MM++JA8}* //GKX", //JK //KK MM++OYG K ..s8}c(mL"%h-X @An$&  NN- .   MMCC5I J KK4SE: ;  s8B?GAG2+GG<GAG#H+=)H&&H+c|jdz}tjj||j dd} |j |r3|j d|d||jj||S|jd|zy#t$r!}|jd|d|Yd }~yd }~wwxYw) z7Copies the specified file from the host to our temp dirrgrzCopying remote z to local zFAttempting to copy remote file %s, but it does not exist on filesystemFzFailed to retrieve rN) rrir~rrmrrr@ retrieve_filerrC)rMr~destdirdestrPs rQr~zSosNode.retrieve_file0s++#ww||GTZZ_R%89 % #W./44T4@@ >@D EF  NN$D E sABB C%CCcdj|j} t|jddkr|jd|zy|j |r4|j d|zd|z}|j |d }|d d k(S|jd |zy#t$r!}|jd |d|Yd}~yd}~wwxYw)z|Removes the spciefied file from the host. This should only be used after we have retrieved the file already rvrgrzJRefusing to remove path %s: appears to be incorrect and possibly dangerousFzRemoving file %szrm -f %sTrrerzHAttempting to remove remote file %s, but it does not exist on filesystemzFailed to remove rN)rrmrrrrrlrC)rMr~rres rQ remove_filezSosNode.remove_fileAswwtzz|$ 4::c?#q( BDH IJ% 0478 4'&&sd&;8})) >@D EF  NNa@ A s$1B-AB-B-- C6CCc|jr|js|jjr |j |j|jd|jz|jd |j|j}|rI|jd|jj|jjddy |jd y|jjr|jj}nF|j j#Dcgc]}|j$s|j%!c}d}|j&j)d |jd ||j d |zy#t $r|j dYywxYw#t $r}|j |Yd}~yd}~wwxYwcc}w)z+Collect the sosreport archive from the nodezFailed to make archive readableFzRetrieving sos report from %szRetrieving sos report...Nz!Successfully collected sos reportrgrTzFailed to retrieve sos reportzFailed to run sos report on rzFailed to run sos report. %s)r5rr*rmake_archive_readablerCrDrr(rr~r8rrmstderrreadrq readlinesr'r=r)rMrnrPrxs rQrzSosNode.retrieve_sosreportXs ==~~!6!6!..t}}= MM9DLLH I KK2 3 ((7 ?@%%dmm&9&9#&>r&BC ;<{{!KK$$&(, (=(=(?K1177QWWYKBO KK  8< aH J NN9A= >5!!NN#DE ! s# Ls5F.;GG5G5.G  G  G2G--G2c|j |jryd|jvr|jd|jzy|j|j}|s|j dyy)zuRemove the sosreport archive from the node, since we have collected it and it would be wasted space otherwiseNr#zFNode sos report path %s looks incorrect. Not attempting to remove pathzFailed to remove sos report)r5rrrrD)rMremoveds rQremove_sos_archivezSosNode.remove_sos_archivezsp == DJJ  dmm + NN79=G H ""4==1 NN8 9rUc|j|jr'dD]"}|j|j|zs"n|jj }|r|j |dyy)z>TYY%:%:!228< ((2NN))(..*=b*AB$$X.NN#?(#JK $ %!'Ch'NO*2C(9: ! $IAMs## $s@"C%B$A&C%$ C"-+CC%C""C%% D.D  Dcd|z}|j|dd}|ddk(ryd}|j|||dfzt)zUsed to make the given archive world-readable, which is slightly better than changing the ownership outright. This is only used when we're not connecting as root. z chmod o+r %s T)r rrerz6Exception while making %s readable. Return code was %s)rlrDrC)rMfilepathrrrbs rQrzSosNode.make_archive_readablesX x'sB$? x=A JC NN3(CM!:: ;OrU)NNT)F)FFFN)5__name__ __module__ __qualname__rRpropertyrGrHr?rcrqr{rIrKrrr`rrrrDrrrLrrrrrErrrlr#rr#r%r'r,r0r2r>r+rbrGrrrrr~rrrrrrrrUrQrr(sGCG @"D % 8"K  C & P  3 -  1%f;P" '$"HF FK-1%4N 2E 23"C  '4R -CCJ'( C 2*X". D : 6$, rUr)r|rr;rirpipesr sos.policiesrsos.policies.init_systemsrsos.collector.transports.jujur(sos.collector.transports.control_persistrsos.collector.transports.localrsos.collector.transports.ocr "sos.collector.transports.saltstackr sos.collector.exceptionsr r r r sos.utilitiesrr[rrrUrQrsc 01F93>AA((    OOrU