+
    Û1jLš  ã            
       óÞ   € ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHtHtHtHt ^ RIHt R]R]R]R]R]/t ! R R4      tR# )é    N)Úquote)Úload)Ú
InitSystem)ÚJujuSSH)ÚSSHControlPersist)ÚLocalTransport)ÚOCTransport)ÚSaltStackMaster)ÚCommandTimeoutExceptionÚConnectionExceptionÚUnsupportedHostExceptionÚInvalidTransportException)Úsos_parse_versionÚlocalÚcontrol_persistÚocÚ	saltstackÚjujuc                   ó„  a € ] tR t^*t o R5R lt]R 4       tR tR tR t	]R 4       t
]R 4       tR	 tR
 tR tR tR6R lt]R 4       tR tR tR tR tR tR tR tR tR tR6R ltR tR tR tR tR7R lt R t!R t"R  t#R! t$R" t%R# t&R$ t'R% t(R& t)R' t*R( t+R) t,R* t-R+ t.R, t/R- t0R. t1R/ t2R0 t3R1 t4R2 t5R3 t6R4t7V t8R# )8ÚSosNodeNc                ó2  € VP                  4       V n        W n        VR ,          V n        V P	                  4        VR,          V n        VR,          V n        VR,          V n        VR,          V n        V P                  P                  V n	        V P                  P                  V n
        RV n        RV n        RV n        RV n        / V n        / V n        T;'       g    V P                  P"                  V n        V P                  P&                  '       g8   V P                  P(                  '       g   V P$                  V P                  n        V'       d   W@P                  n        RV n        RV n        RV n        . V n        RRR. R	. R
. R. RVR,          /V n        RV n        \6        P8                  ! R4      V n        \6        P8                  ! R4      V n        V P?                  V4      V n         V P@                  PB                  '       d   V P@                  PB                  R8g  V n         V P@                  PE                  V P$                  4       T PK                  4       T n        RT n&        T P@                  P                  T n        T P                  '       d   T P                  PN                  '       d   RpT PP                  '       d¬   T'       d¤   T P                  '       g   T P@                  PS                  4        R# T P                  '       d(   T PU                  4       '       d   RT P                  n+        T P                  PV                  '       d   T PY                  4        T P[                  4        R#   \F         d   pT PI                  RT 24       h Rp?ii ; i)ÚcmdlineoptsÚtmpdirÚhostlenÚ	need_sudoÚsos_optionsFNÚversionÚenabledÚdisabledÚoptionsÚpresetsÚsos_cmdÚ	sosreportÚsosÚsos_uiÚrootzUnable to open remote session: ).ÚstripÚaddressÚcommonsÚoptsÚ_assign_config_optsr   r   r   r   Únode_config_fileÚinherit_config_filer   ÚhostÚclusterÚhostnameÚsos_env_varsÚ	_env_varsÚpasswordÚ	_passwordÚnopasswd_sudoÚsudo_pwÚsos_pathÚ	retrievedÚhash_retrievedÚ	file_listÚsos_infoÚsos_binÚloggingÚ	getLoggerÚsoslogÚui_logÚ_load_remote_transportÚ
_transportÚdefault_userÚconnectÚ	ExceptionÚ	log_errorÚdetermine_host_policyÚ_sudo_binaryÚno_localÚ	connectedÚ
disconnectÚcheck_in_containerÚcontainerizedÚcreate_sos_containerÚ_load_sos_info)Úselfr(   r)   r3   Ú
local_sudoÚ
load_factsÚerrs   &&&&&& Ú7/usr/lib/python3/dist-packages/sos/collector/sosnode.pyÚ__init__ÚSosNode.__init__,   s³  € à—}‘}“ˆŒØŒØ˜MÕ*ˆŒ	Ø× Ñ Ô"Ø˜hÕ'ˆŒØ˜yÕ)ˆŒØ  Õ-ˆŒØ" =Õ1ˆÔØ $§	¡	× :Ñ :ˆÔØ#'§9¡9×#@Ñ#@ˆÔ ØˆŒ
ØˆŒ	ØˆŒØˆŒØˆÔØˆŒØ!×7Ð7 T§Y¡Y×%7Ñ%7ˆŒØ�y‰y×&×&Ð&¨t¯y©y×/@×/@Ð/@Ø $§¡ˆD�I‰IÔçØ *�I‰IÔØˆŒØˆŒØ#ˆÔØˆŒà�tØ�rØ˜Ø�rØ�rØ�w˜yÕ)ð
ˆŒð #ˆŒÜ×'Ò'¨Ó.ˆŒÜ×'Ò'¨Ó1ˆŒØ×5Ñ5°gÓ>ˆŒð �?‰?×'×'Ð'Ø!Ÿ_™_×9Ñ9¸VÑCˆDŒNð	Ø�O‰O×#Ñ# D§N¡NÔ3ð ×.Ñ.Ó0ˆŒ	Ø ˆÔØŸ™×0Ñ0ˆŒØ�:�:ˆ:˜$Ÿ)™)×,×,Ð,ØˆJØ�>�>ˆ>ŸjØ—9—9�9Ø—‘×*Ñ*Ô,ÙØ�z�zˆzØ×*Ñ*×,Ò,Ø.3�D—I‘IÔ+Ø�y‰y×&×&Ð&Ø×)Ñ)Ô+Ø×ÑÔ!Ùøô- ô 	Ø�N‰NÐ<¸S¸EÐBÔCØûð	ús   È&%M1 Í1NÍ<NÎNc                óV   € V P                   '       d   V P                   P                  # R # )T)rB   rJ   ©rP   s   &rT   rJ   ÚSosNode.connectedr   s   € à�?�?ˆ?Ø—?‘?×,Ñ,Ð,áó    c                ó:   € V P                   P                  4        R# )zDWrapper to close the remote session via our transport agent
        N)rB   rK   rX   s   &rT   rK   ÚSosNode.disconnecty   s   € ð 	�‰×"Ñ"Ö$rZ   c                óð  € V P                   R9   d   RV n        \        V P                   V4      # V P                  P                  \
        9   d3   \
        V P                  P                  ,          ! V P                   V4      # V P                  P                  R8w  dH   V P                  RV P                  P                   24       \        V P                  P                  4      h\        V P                   V4      # )zuDetermine the type of remote transport to load for this node, then
return an instantiated instance of that transport
TÚautoz4Connection failed: unknown or unsupported transport )Ú	localhostz	127.0.0.1)	r(   r   r   r*   Ú	transportÚ
TRANSPORTSrF   r   r   )rP   r)   s   &&rT   rA   ÚSosNode._load_remote_transport~   s¹   € ð �<‰<Ð5Ô5ØˆDŒJÜ! $§,¡,°Ó8Ð8Ø�9‰9×Ñ¤*Ô,Ü˜dŸi™i×1Ñ1Ö2°4·<±<ÀÓIÐIØ�9‰9×Ñ &Ô(Ø�N‰NØFØ—9‘9×&Ñ&Ð'ð)ôô ,¨D¯I©I×,?Ñ,?Ó@Ð@Ü  §¡¨wÓ7Ð7rZ   c                óN   € V P                   R V P                  ^,            2 RV 2# )Ú<z : )Ú	_hostnamer   ©rP   Úmsgs   &&rT   Ú_fmt_msgÚSosNode._fmt_msg�   s+   € Ø—.‘.  4§<¡<°!Õ#3Ð"4Ð 4Ð5°S¸¸Ð>Ð>rZ   c                ó¬  € V P                   '       g¸   V P                  '       d0   \        P                  P	                  4       V n         V P                   # V P                  R 4      pVR,          ^ 8X  dX   VR,          P                  R4       F;  pV'       g   K  VP                  R4      pV^,          V P                   V^ ,          &   K=  	  V P                   # )z
env --nullÚstatusÚoutputÚ Ú=)r2   r   ÚosÚenvironÚcopyÚrun_commandÚsplit)rP   ÚretÚlnÚ_vals   &   rT   Úenv_varsÚSosNode.env_vars’   sž   € à�~�~ˆ~Ø�z�zˆzÜ!#§¡§¡Ó!2�”ð �~‰~Ðð ×&Ñ& |Ó4�Ø�x•= AÔ%Ø! (�m×1Ñ1°&Ö9˜ß!Ù$Ø!Ÿx™x¨›}˜Ø26°qµ'˜Ÿ™ t¨A¥wÓ/ñ	 :ð
 �~‰~ÐrZ   c                óJ  € V P                   '       g‡   V P                  P                  P                  R 4      R,          pV P	                  RV 24      ;p'       d0   VR,          ^ 8X  g"   RV 2pV P                  V4       \        V4      hVR8X  d   RpWn         V P                   # )Ú/zcommand -v rk   z*Privilege escalation command not in PATH: Úsudozsudo -Séÿÿÿÿ)rH   r*   Úsudo_binaryrs   rr   rF   rE   )rP   Ú_binrt   rS   s   &   rT   r}   ÚSosNode.sudo_binary¡   s–   € à× × Ð Ø—9‘9×(Ñ(×.Ñ.¨sÓ3°BÕ7ˆDà×&Ñ&¨°T°FÐ';Ó<Ð<ˆsÖ<Ø˜8•}¨Ô)ØFÀtÀfÐM�CØ—N‘N 3Ô'Ü# C›.Ð(Ø�vŒ~Ø �Ø $ÔØ× Ñ Ð rZ   c                ó°  € Wn         V P                   P                  RV P                  4       V P                   P                  RV P                  P                  4       V P                   P                  RV P
                  R,          4       V P                   P                  RR4       V P                   P                  RV P                  P                  4       R# )	z>Set the manifest section that this node will write to
        r0   ÚpolicyÚsos_versionr   Úfinal_sos_commandÚ r`   N)ÚmanifestÚ	add_fieldre   r.   Úos_release_namer;   rB   Úname)rP   r…   s   &&rT   Úset_node_manifestÚSosNode.set_node_manifest°   s�   € ð !ŒØ�‰×Ñ 
¨D¯N©NÔ;Ø�‰×Ñ ¨$¯)©)×*CÑ*CÔDØ�‰×Ñ ¨t¯}©}¸YÕ/GÔHØ�‰×ÑÐ 3°RÔ8Ø�‰×Ñ ¨T¯_©_×-AÑ-AÖBrZ   c                óÞ   € \         P                  P                  R4      '       d   V P                  R4       R# \         P                  P                  R4      e   V P                  R4       R# R# )zF
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)ro   ÚpathÚexistsÚ	log_debugrp   ÚgetrX   s   &rT   rL   ÚSosNode.check_in_containerº   sN   € ô �7‰7�>‰>Ð.×/Ò/Ø�N‰NÐLÔMÙÜ�:‰:�>‰>˜+Ó&Ò2Ø�N‰NÐLÔMÙÙrZ   c                ó&  € V P                   P                  '       Edt   V P                   P                  V P                  P                  V P                  4       V P                  P                  R7      pV P                  VRR7      pVR,          R9   dÞ   VR,          ^}8X  dK   RVR,          9   d   V P                  R4       \        hRVR,          9   d   V P                  R	4       \        hV P                  V P                   P                  4       RR7      pVR,          ^ 8X  d,   V P                  R
V P                   P                   R24       R# V P                  RVR,           24       \        hV P                  RVR,           24       \        hR# )zJIf the host is containerized, create the container we'll be using
        )ÚimageÚauthÚ
force_pullT©Ú	need_rootrk   zunable to retrieve auth tokenrl   zHCould not pull image. Provide either a username and password or authfilezunknown: Not foundz%Specified image not found on registryzTemporary container z createdz(Could not start container after create: z$Could not create container on host: F)r   é}   )r.   rM   rN   r*   r“   Úget_container_authÚforce_pull_imagerr   rF   rE   Úrestart_sos_containerÚlog_infoÚsos_container_name)rP   ÚcmdÚresrt   s   &   rT   rN   ÚSosNode.create_sos_containerÆ   si  € ð �9‰9×"×"Ñ"Ø—)‘)×0Ñ0Ø—i‘i—o‘oØ×,Ñ,Ó.ØŸ9™9×5Ñ5ð 1ó ˆCð
 ×"Ñ" 3°$Ð"Ó7ˆCØ�8�} Ô(Ø�x•= CÔ'Ø6¸#¸h½-ÔGØŸ™ð7ôô (˜Ø+¨s°8­}Ô<ØŸ™Ð'NÔOÜ'˜ð
 ×&Ñ& t§y¡y×'FÑ'FÓ'HØ15ð 'ó 7�à�x•= AÔ%Ø—M‘MÐ"8Ø%)§Y¡Y×%AÑ%AÐ$BÀ(ð#Lô MáØ—‘ÐIØ"% h¥- ð 2ô 3ä�à�N‰NÐAØ! (�m˜_ð.ô /äˆOÙrZ   c                ó   € V P                   P                  '       dV   V P                  P                  R,          P	                  V P                   P                  V P                   P
                  4      # V P                  P                  R,          P                  V P                   P                  ;'       g    V P                  P                  4      # )zbDetermine what the auth string should be to pull the image used to
deploy our temporary container
Údefault)	r*   Úregistry_userr.   ÚruntimesÚfmt_registry_credentialsÚregistry_passwordÚfmt_registry_authfileÚregistry_authfileÚcontainer_authfilerX   s   &rT   r™   ÚSosNode.get_container_authî   s“   € ð �9‰9×"×"Ð"Ø—9‘9×%Ñ% iÕ0×IÑIØ—	‘	×'Ñ'Ø—	‘	×+Ñ+óð ð �y‰y×!Ñ! )Õ,×BÑBØ�I‰I×'Ñ'×GÐG¨4¯9©9×+GÑ+Gó
ð 	
rZ   c                ól   €  V P                  RV 2VR7      pVR,          ^ 8H  #   \         d     R# i ; i)z3Checks for the presence of fname on the remote nodezstat r–   rk   F)rr   rE   )rP   Úfnamer—   rŸ   s   &&& rT   Úfile_existsÚSosNode.file_existsû   sC   € ð	Ø×"Ñ" U¨5¨' ?¸iÐ"ÓHˆCØ�x•= AÑ%Ð%øÜô 	Úð	ús   ‚!$ ¤3²3c                óx   € V P                   '       d   R V P                   9  d   V P                   # V P                  # )r_   )r0   r(   rX   s   &rT   re   ÚSosNode._hostname  s*   € à�=�=ˆ=˜[°·±Ô=Ø—=‘=Ð Ø�|‰|ÐrZ   c                ó6   € Rp\         P                  ! VRV4      # )zMAttempts to obfuscate sensitive information in log messages such as
passwordsz>(?P<var>(pass|key|secret|PASS|KEY|SECRET).*?=)(?P<value>.*?\s)z\g<var>****** )ÚreÚsub)rP   rg   Úregs   && rT   Ú_sanitize_log_msgÚSosNode._sanitize_log_msg	  s   € ð PˆÜ�vŠv�cÐ,¨cÓ2Ð2rZ   c                óZ   € V P                   P                  V P                  V4      4       R# )z:Format a ui message that includes host name and formattingN)r@   Úinforh   rf   s   &&rT   Úui_msgÚSosNode.ui_msg  s   € à�‰×Ñ˜Ÿ™ sÓ+Ö,rZ   c                ó¬   € \         P                  ! 4       ^,          ^,          pRV P                   RV RV 2pV P                  P	                  V4       R# )z#Used to print and log info messagesÚ[Ú:ú] N)ÚinspectÚstackre   r?   r¸   ©rP   rg   ÚcallerÚlmsgs   &&  rT   rœ   ÚSosNode.log_info  sF   € ä—’“ Õ# AÕ&ˆØ�4—>‘>Ð" ! F 8¨2¨c¨UÐ3ˆØ�‰×Ñ˜ÖrZ   c                ó¬   € \         P                  ! 4       ^,          ^,          pRV P                   RV RV 2pV P                  P	                  V4       R# )z$Used to print and log error messagesr¼   r½   r¾   N)r¿   rÀ   re   r?   ÚerrorrÁ   s   &&  rT   rF   ÚSosNode.log_error  sF   € ä—’“ Õ# AÕ&ˆØ�4—>‘>Ð" ! F 8¨2¨c¨UÐ3ˆØ�‰×Ñ˜$ÖrZ   c                óÎ   € V P                  V4      p\        P                  ! 4       ^,          ^,          pRV P                   RV RV 2pV P                  P                  V4       R# )z$Used to print and log debug messagesr¼   r½   r¾   N)rµ   r¿   rÀ   re   r?   Údebug)rP   rg   rÂ   s   && rT   r�   ÚSosNode.log_debug  sV   € à×$Ñ$ SÓ)ˆÜ—’“ Õ# AÕ&ˆØ�$—.‘.Ð!  6 (¨"¨S¨EÐ2ˆØ�‰×Ñ˜#ÖrZ   c                óP  € V P                   P                  R\        P                  P                  R4      4      R8H  pV P                  '       d   V'       d   V# V P
                  P                  '       d   R\        V4       2# V P                  '       d   V P                   RV 2# V# )zrIf we need to provide a sudo or root password to a command, then
here we prefix the command with the correct bits
ÚUSERr&   zsu -c Ú )
r2   r�   ro   rp   r   r*   Úbecome_rootr   r   r}   )rP   rž   Úis_roots   && rT   Ú_format_cmdÚSosNode._format_cmd&  sƒ   € ð —.‘.×$Ñ$ V¬R¯Z©Z¯^©^¸FÓ-CÓDÈÑNˆØ�:�:ˆ:Ÿ'ØˆJØ�9‰9× × Ð ØœE #›J˜<Ð(Ð(Ø�>�>ˆ>Ø×&Ñ&Ð' q¨¨Ð.Ð.Øˆ
rZ   c                ó  € RpRpV P                   P                  fo   V P                   P                  P                  V P                   P                  4      pVe1   RP                  VR,          4      pVR,          '       d
   VR,          pM_V P                  V P                   P                  RRR7      pVR,          ^ 8X  d*   VR,          P                  4       P                  R	4      w  rQpV'       dL   \        VP                  R4      4      ^8X  d
   VR
,          p VR	VP                  R4      ^ ,           2,          pWP                  R&   V P                  R,          '       d'   V P                  RV P                  R,           24       M?V P                  V P                  P                   8X  g   V P#                  R4       RV n        R# V P'                  R4      '       d   RV n        V P(                   R2pV P                  VRRR7      pVR,          ^ 8X  d   V P+                  VR,          4       V P'                  R4      '       d   V P-                  4        R#   \         d    pT P                  RT 24        Rp?ELARp?ii ; i)zLQueries the node for information about the installed version of sos
        NÚ.r   ÚreleaseT©Úuse_containerr—   rk   rl   Ú-z.0z#Unable to fully parse sos release: zsos version is z!sos is not installed on this nodeFz4.0z
sos reportz -lú3.6)r.   Úcontainer_version_commandÚpackage_managerÚpkg_versionÚsos_pkg_nameÚjoinrr   r'   rs   ÚlenrE   r�   r;   rœ   r(   r*   ÚprimaryrF   rJ   Úcheck_sos_versionr<   Ú_load_sos_pluginsÚ_load_sos_presets)	rP   ÚverÚrelÚpkgÚpkgsÚ_rS   rž   Úsosinfos	   &        rT   rO   ÚSosNode._load_sos_info3  s  € ð ˆØˆØ�9‰9×.Ñ.Ò6Ø—)‘)×+Ñ+×7Ñ7¸¿	¹	×8NÑ8NÓOˆCØŠØ—h‘h˜s 9�~Ó.�Ø�y—>”>Ø˜i�.�Cøð ×#Ñ# D§I¡I×$GÑ$GØ26À$ð $ó HˆDà�H�~ Ô"Ø" 8�n×2Ñ2Ó4×:Ñ:¸3Ó?‘�˜çÜ�3—9‘9˜S“>Ó" aÔ'ð �t•�ðLØ˜˜3Ÿ9™9 S›>¨!Õ,Ð-Ð.Õ.�ð $'�‰�iÑ à�=‰=˜×#Ô#Ø�M‰M˜O¨D¯M©M¸)Õ,DÐ+EÐFÕGà—<‘< 4§9¡9×#4Ñ#4Ô4ð —‘ÐBÔCØ"ˆDŒNÙà×!Ñ! %×(Ò(Ø'ˆDŒLØ—‘�˜cÐ"ˆØ×"Ñ" 3°dÀdÐ"ÓKˆØ�8Õ Ô!Ø×"Ñ" 7¨8Õ#4Ô5Ø×!Ñ! %×(Ò(Ø×"Ñ"Ô$Ùøô1 ô LØ—‘Ð!DÀSÀEÐJ×KÒKûðLús   Ä"I ÉJÉ$I>É>Jc                ó†  € V P                    R 2pV P                  VRRR7      pVR,          ^ 8X  d�   VR,          P                  4        Fr  pVP                  4       P	                  R4      '       g   K*  VP                  R4      ^,          P                  4       pV P                  R,          P                  V4       Kt  	  R# R# )z --list-presetsTrÕ   rk   rl   zname:r!   N)r<   rr   Ú
splitlinesr'   Ú
startswithrs   r;   Úappend)rP   rž   rŸ   ÚlineÚpnames   &    rT   râ   ÚSosNode._load_sos_presetsg  s›   € Ø—‘�˜oÐ.ˆØ×Ñ˜s°$À$ÐÓGˆØˆx�=˜AÔØ˜H�×0Ñ0Ö2�Ø—:‘:“<×*Ñ*¨7×3Ô3Ø ŸJ™J wÓ/°Õ2×8Ñ8Ó:�EØ—M‘M )Õ,×3Ñ3°EÖ:ó 3ñ rZ   c                óŒ  € R pRpRpRpRpVR,           V,           pVR,           V,           pVR,           V,           p	VR,           R,           p
V P                  Wq4      V P                  R&   V P                  W�4      V P                  R&   V P                  W‘4      V P                  R	&   V P                  W¡R
4      V P                  R&   R# )z,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

r   r   r    TÚprofilesN)Ú_regex_sos_helpr;   )rP   rè   ÚENABLEDÚDISABLEDÚALL_OPTIONSÚOPTIONSÚPROFILESÚ	enableregÚdisregÚoptregÚproregs   &&         rT   rá   ÚSosNode._load_sos_pluginsp  s½   € Ø@ˆØBˆØLˆØ?ˆØˆà˜gÕ%¨Õ0ˆ	Ø˜GÕ# kÕ1ˆØ˜7Õ" XÕ-ˆØ˜GÕ# fÕ,ˆà#'×#7Ñ#7¸	Ó#Kˆ�‰�iÑ Ø$(×$8Ñ$8¸Ó$Iˆ�‰�jÑ!Ø#'×#7Ñ#7¸Ó#Hˆ�‰�iÑ Ø$(×$8Ñ$8¸È$Ó$Oˆ�‰�jÓ!rZ   c                ó¶  € . p\         P                  ! W\         P                  4       F€  pVP                  4        Fi  pV'       g6    VP	                  4       ;p'       d   VP                  V^ ,          4       K>  K@  VP	                  R4      p	VP                  R V	 4       4       Kk  	  K‚  	  V#   \         d    pT P                  RT 24        Rp?K˜  Rp?ii ; i)r   zError parsing sos help: NÚ,c              3   óp   "  € T F,  qP                  4       '       g   K  VP                  4       x € K.  	  R # 5i©N)r'   )Ú.0Úps   & rT   Ú	<genexpr>Ú*SosNode._regex_sos_help.<locals>.<genexpr>�  s    é € ÐA±!¨Q·w±w·yœy˜qŸw™wŸy˜y³!ùs   ‚6ž6)	r²   ÚfindallÚSrë   rs   rí   rE   r�   Úextend)
rP   Úregexrè   Úis_listrŸ   Úresultrî   ÚlsrS   Úrs
   &&&&      rT   ró   ÚSosNode._regex_sos_help�  sµ   € ØˆÜ—j’j ´·±Ö6ˆFØ×)Ñ)Ö+�ßðIØ!%§¡£Ð-˜2Ö-ØŸJ™J r¨!¥uÖ-ñ .ð
 Ÿ
™
 3›�AØ—J‘JÑA±!ÓAÖAó ,ñ 7ð ˆ
øô %ô IØŸ™Ð)AÀ#ÀÐ'G×HÒHûðIús   ÁB.ÁB.Â.CÂ9CÃCc                óÂ   €  V P                  RV 24       V P                  P                  V4      #   \         d#   pT P	                  RT RT 24        Rp?R# Rp?ii ; i)z1Reads the specified file and returns the contentszReading file zException while reading ú: Nr„   )rœ   rB   Ú	read_filerE   rF   )rP   Úto_readrS   s   && rT   r  ÚSosNode.read_file�  s\   € ð	Ø�M‰M˜M¨'¨Ð3Ô4Ø—?‘?×,Ñ,¨WÓ5Ð5øÜô 	Ø�N‰NÐ5°g°Y¸bÀÀÐFÔGÝûð	ús   ‚.1 ±A¼AÁAc           
     óÊ  € V P                   '       dC   V P                  RV P                  R,          P                   24       V P                  R,          # \	        / V P
                  P                  \        4       RV P                  P                  V P                  R4      R7      pV'       d"   V P                  RVP                   R24       V# V P                  R4       \        h)	zKAttempts to identify the host installation against supported
distributions
zusing local policy r�   Tz/etc/os-release)ÚcacheÚsysrootÚinitÚprobe_runtimeÚremote_execÚremote_checkzloaded policy z	 for hostz4Unable to determine host installation. Ignoring node)r   rœ   r)   r‡   r   r*   r  r   rB   rr   r  rF   r   )rP   r.   s   & rT   rG   ÚSosNode.determine_host_policy™  s¶   € ð �:�:ˆ:Ø�M‰MØ% d§l¡l°8Õ&<×&LÑ&LÐ%MÐNôPà—<‘< Õ)Ð)Ü˜" d§i¡i×&7Ñ&7¼j»lØ"&Ø $§¡× ;Ñ ;Ø!%§¡Ð0AÓ!BôDˆ÷ Ø�M‰M˜N¨4×+?Ñ+?Ð*@À	ÐJÔKØˆKØ�‰ÐMÔNÜ&Ð&rZ   c                ó²   €  V P                   R,          p\        V4      \        V4      8¬  #   \         d    pT P                  RT 24        Rp?R# Rp?ii ; i)aX  Checks 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``
r   zError checking sos version: NF)r;   r   rE   rF   )rP   rã   Ú	_node_verrS   s   &&  rT   rà   ÚSosNode.check_sos_version«  sR   € ð	ØŸ™ iÕ0ˆIÜ$ YÓ/Ô3DÀSÓ3IÑIÐIøÜô 	Ø�N‰NÐ9¸#¸Ð?Ô@Ýûð	ús   ‚), ¬A·AÁAc                óx   € V P                   '       g   R# V P                   P                  P                  V4      RJ# )z2Checks if a given package is installed on the nodeFN)r.   rÚ   Úpkg_by_name)rP   rå   s   &&rT   Úis_installedÚSosNode.is_installed½  s.   € à�y�yˆyÙØ�y‰y×(Ñ(×4Ñ4°SÓ9ÀÐEÐErZ   c                ó|  € V P                   '       gj   V P                  '       gX   V P                  R4        V P                  P	                  V P
                  4      pV'       g   V P                  R4       \        h V'       d8   V P                  P                  '       d   V P                  P                  V4      pV'       d   V P                  V4      pV'       d   V P                  p	V	P                  V4      pV P                  P                  WWFV4      #   \         d   pT P                  RT 24       h Rp?ii ; i)a9  Runs a given cmd, either via the SSH session or locally

:param cmd:     The full command to be run
:type cmd:      ``str``

:param timeout: Time in seconds to wait for `cmd` to complete
:type timeout:  ``int``

:param use_shell: If a shell is needed to run `cmd`, set to True
:type use_shell:  ``bool`` or ``auto`` for transport-determined

:param use_container: Run this command in a container *IF* the host
                      is a containerized host
:type use_container: ``bool``

:param env: Pass environment variables to set for this `cmd`
:type env:  ``dict``
z-Node is disconnected, attempting to reconnectzFailed to reconnect to nodez!Error while trying to reconnect: N)rJ   r   r�   rB   Ú	reconnectr4   r   rE   r.   rM   Úformat_container_commandrÐ   rw   Úupdaterr   )
rP   rž   ÚtimeoutÚ	use_shellr—   rÖ   ÚenvÚreconnectedrS   Ú_cmd_envs
   &&&&&&&   rT   rr   ÚSosNode.run_commandÃ  sö   € ð( �~�~ˆ~ d§j§j jØ�N‰NÐJÔKðØ"Ÿo™o×7Ñ7¸¿¹ÓG�ß"Ø—N‘NÐ#@ÔAÜ-Ð-ð #÷ ˜TŸY™Y×4×4Ð4Ø—)‘)×4Ñ4°SÓ9ˆCßØ×"Ñ" 3Ó'ˆCßØ—}‘}ˆHØ—/‘/ #Ó&ˆCØ�‰×*Ñ*¨3¸Ø+4ó6ð 	6øô ô Ø—‘Ð!BÀ3À%ÐHÔIØûðús   ·,D Á$D ÄD;Ä!D6Ä6D;c                óD  €  V P                  4       pV'       d   V P                  V4       MV P                  R4       V P                  '       d   V P	                  4       V n        T P                  4        R#   \         d   pT P                  RT 24        Rp?L6Rp?ii ; i)z.Run an sos report on the node, then collect itz'Unable to determine path of sos archivezError during sos execution: N)Úexecute_sos_commandÚfinalize_sos_pathrF   r7   Úretrieve_sosreportr8   rE   Úcleanup)rP   r�   rS   s   &  rT   r#   ÚSosNode.sosreportë  sƒ   € ð		AØ×+Ñ+Ó-ˆDßØ×&Ñ& tÕ,à—‘ÐHÔIØ�}�}ˆ}Ø!%×!8Ñ!8Ó!:�”ð 	�‰Žøô ô 	AØ�N‰NÐ9¸#¸Ð?×@Ñ@ûð	Aús"   ‚A6 š4A6 ÁA6 Á6BÂBÂBc                ó,   € WP                   R,          9   # )z/Verifies if the given preset exists on the noder!   ©r;   )rP   Úpresets   &&rT   Ú_preset_existsÚSosNode._preset_existsù  ó   € àŸ™ yÕ1Ñ1Ð1rZ   c                ó  a€ \         ;QJ dC    V3R lV P                  R,          V P                  R,          3 4       F  '       g   K   R# 	  R# ! V3R lV P                  R,          V P                  R,          3 4       4      # )z/Verifies if the given plugin exists on the nodec              3   ó.   <"  € T F
  pSV9   x € K  	  R # 5ir  © )r  ÚsÚplugins   & €rT   r  Ú)SosNode._plugin_exists.<locals>.<genexpr>ÿ  s    øé € ð Eñ )D 1�6˜Q–;ó )Dùó   ƒr   r   TF)Úanyr;   ©rP   r=  s   &frT   Ú_plugin_existsÚSosNode._plugin_existsý  sz   ø€ ç‹sô E¨¯©°yÕ)AØ)-¯©°zÕ)Bñ)Dó E�sŒsð 	EŠsð 	Eˆsô E¨¯©°yÕ)AØ)-¯©°zÕ)Bñ)Dó Eó Eð 	ErZ   c                ó,   € WP                   R,          9   # )z6Checks to see if the plugin is default enabled on noder   r4  rA  s   &&rT   Ú_check_enabledÚSosNode._check_enabled  r8  rZ   c                ó,   € WP                   R,          9   # )z7Checks to see if the plugin is default disabled on noder   r4  rA  s   &&rT   Ú_check_disabledÚSosNode._check_disabled  s   € àŸ™ zÕ2Ñ2Ð2rZ   c                ó&  € VP                  R4      ^ ,          pV P                  V4      '       g   R# V P                  V4      '       d   W P                  P                  9  d   R# V P                  V4      '       d   WP                  R,          9   # R# )zßAttempts 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 notrÓ   Fr    T)rs   rB  rH  r*   Úenable_pluginsrE  r;   )rP   ÚoptÚplugs   && rT   Ú_plugin_option_existsÚSosNode._plugin_option_exists
  sv   € ð
 �y‰y˜‹~˜aÕ ˆØ×"Ñ" 4×(Ò(ÙØ× Ñ  ×&Ò&ØŸI™I×4Ñ4Ô4ÙØ×Ñ˜t×$Ò$ØŸ-™-¨	Õ2Ñ2Ð2ñ rZ   c                ó:   a € RP                  V 3R lV 4       4      # )zVReturns a comma delimited list for sos plugins that are confirmed
to exist on the noderÿ   c              3   óZ   <"  € T F   pSP                  V4      '       g   K  Vx € K"  	  R # 5ir  )rB  )r  ÚorP   s   & €rT   r  Ú,SosNode._fmt_sos_opt_list.<locals>.<genexpr>  s    øé € ÐB¡4˜a¨4×+>Ñ+>¸q×+AŸš£4ùs   ƒ+¡
+)rÝ   )rP   r*   s   f&rT   Ú_fmt_sos_opt_listÚSosNode._fmt_sos_opt_list  s   ø€ ð �x‰xÔB¡4ÓBÓBÐBrZ   c                ó   € Wn         R# )zFExpose the node to the cluster profile determined for the
environment
N)r/   )rP   r/   s   &&rT   Úset_clusterÚSosNode.set_cluster   s	   € ð ŽrZ   c                óÜ  a€ V P                   P                  '       dX   V P                  '       g   V P                   P                  V n        M)V P                  RV P                   P                   R24       V P                   P                  '       dK   V P                   P                   F0  pWP
                  9  g   K  V P
                  P                  V4       K2  	  V P                   P                  '       d[   V P                   P                   F@  oSV P                  9  g   K  V P                   P                  S,          V P                  S&   KB  	  V P                   P                  '       d±   V P                   P                   F–  o\        ;QJ d)    V3R lV P                   4       F  '       g   K   RM	  RM! V3R lV P                   4       4      '       d   KY  S RV P                   P                  S,           2pV P                  P                  V4       K˜  	  V P                   P                  V 4      '       dE   V P                   P                  ;_uu_ 4        V P                   P                  V 4       RRR4       R# V P                   P                  ;_uu_ 4        V P                   P                  V 4       RRR4       R#   + '       g   i     R# ; i  + '       g   i     R# ; i)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.
zCluster specified preset z> but user has also defined a preset. Using user specification.c              3   ó.   <"  € T F
  pSV9   x € K  	  R # 5ir  r;  )r  rR  rL  s   & €rT   r  Ú2SosNode.update_cmd_from_cluster.<locals>.<genexpr>B  s   øé € Ð;©]¨˜3 !ž8«]ùr?  TFrn   N)r/   Ú
sos_presetr5  rœ   Úsos_pluginsrK  rí   r   Úsos_plugin_optionsr@  ÚplugoptsÚcheck_node_is_primaryÚlockÚset_primary_optionsÚset_node_options)rP   rM  ÚoptionrL  s   &  @rT   Úupdate_cmd_from_clusterÚSosNode.update_cmd_from_cluster&  sú  ø€ ð �<‰<×"×"Ð"Ø—;—;�;Ø"Ÿl™l×5Ñ5�•à—‘Ð9Ø!%§¡×!8Ñ!8Ð 9ð :LðLô Mð �<‰<×#×#Ð#ØŸ™×0Ô0�Ø×2Ñ2Ö2Ø×'Ñ'×.Ñ.¨tÖ4ñ 1ð �<‰<×#×#Ð#Ø—|‘|×/Ô/�à˜d×.Ñ.Ö.Ø,0¯L©L×,DÑ,DÀSÕ,I�D×$Ñ$ SÓ)ñ 0ð
 �<‰<×*×*Ð*Ø—|‘|×6Ô6�ß“sÔ;¨T¯]ª]Ó;—s—s’sÔ;¨T¯]ª]Ó;×;Ô;Ø #˜u A d§l¡l×&EÑ&EÀcÕ&JÐ%KÐL�FØ—M‘M×(Ñ(¨Ö0ñ 7ð �<‰<×-Ñ-¨d×3Ò3Ø—‘×"×"Ó"Ø—‘×0Ñ0°Ô6÷ #Ñ"ð —‘×"×"Ó"Ø—‘×-Ñ-¨dÔ3÷ #Ñ"÷ #×"Ð"ú÷ #×"Ð"ús   ÉKÊ KËK	ËK+	c                ón  € \        V P                  P                  4      V n        \        V P                  P                  4      V n        \        V P                  P                  4      V n        \        V P                  P
                  4      V n        \        V P                  P                  4      V n        R# )zxFrom the global opts configuration, assign those values locally
to this node so that they may be acted on individually.
N)Úlistr*   Úonly_pluginsÚskip_pluginsrK  r_  r5  rX   s   &rT   r+   ÚSosNode._assign_config_optsN  su   € ô
 ! §¡×!7Ñ!7Ó8ˆÔÜ  §¡×!7Ñ!7Ó8ˆÔÜ" 4§9¡9×#;Ñ#;Ó<ˆÔÜ˜TŸY™Y×/Ñ/Ó0ˆŒÜ˜4Ÿ9™9×+Ñ+Ó,ˆŽrZ   c           	     óÈ  € V P                   R,          pV P                  4       pV'       d   V R\        V4       R2p. pV P                  R4      '       dV   V P                  P
                  ^8w  d;   VP                  R\        \        V P                  P
                  4      4       24       V P                  R4      '       dW   V P                  P                  '       d;   VP                  R\        \        V P                  P                  4      4       24       V P                  R4      '       d¨   V P                  P                  '       d   VP                  R4       V P                  P                  '       d   VP                  R	4       V P                  P                  '       d2   VP                  R
\        V P                  P                  4       24       V P                  R4      '       d¹   V P                  P                  '       dA   VP                  R\        RP                  V P                  P                  4      4       24       V P                  P                  '       dA   VP                  R\        RP                  V P                  P                  4      4       24       V P                  R4      '       dW   V P                  P                  '       d;   VP                  R\        \        V P                  P                  4      4       24       V P                  R4      '       g   V P                  R4      '       dˆ   V P                  P                   R8w  d)   VP                  RV P                  P                    24       V P                  P"                  '       d)   VP                  RV P                  P"                   24       V P                  R4      '       dr   V P                  P$                  '       d)   VP                  RV P                  P$                   24       V P                  P&                  '       d   VP                  R4       V P)                  4        VP+                  R\,        P.                  P                  V P0                  P2                  V P4                  4      4      pV P6                   F7  pV P6                  V,          pTP                  RT RV'       d   TMR 24       K9  	  V P8                  '       dµ   V P8                   Uu. uFc  pV P;                  VP=                  R4      ^ ,          4      '       g   K2  V P?                  VP=                  R4      ^ ,          4      '       g   Ka  VNKe  	  ppV'       d4   VP                  R\        RP                  R V 4       4      4       24       V P@                  '       di   V PC                  V P@                  4      '       d)   VP                  R \        V P@                  4       24       MV PE                  R!V P@                   R"24       V PF                  '       Ed;   V PF                   Uu. uF  q`P;                  V4      '       g   K  VNK  	  pp\I        V4      \I        V PF                  4      8w  dD   \K        \M        V PF                  4      \M        V4      ,
          4      p	V PE                  R#V	 R$24       V PO                  V PF                  4      p
V
'       d   VP                  R%\        V
4       24       V RRP                  V4       2V n(        V PS                  R&V PP                   24       V PT                  PW                  R'V PP                  4       R(# V PX                  '       dÐ   V PX                   Uu. uF  q`P[                  V4      '       g   K  VNK  	  pp\I        V4      \I        V PX                  4      8w  dD   \K        \M        V PX                  4      \M        V4      ,
          4      pV PE                  R)V R*24       V PO                  V4      pV'       d   VP                  R+\        V4       24       V P\                  '       dü   V P\                   Uu. uFI  pW`PX                  9  g   K  V P_                  V4      '       g   K.  V P;                  V4      '       g   KG  VNKK  	  pp\I        V4      \I        V P\                  4      8w  dD   \K        \M        V P\                  4      \M        V4      ,
          4      pV PE                  R,V R-24       V PO                  V4      pV'       d   VP                  R.\        V4       24       V RRP                  V4       2V n(        V PS                  R&V PP                   24       V PT                  PW                  R'V PP                  4       R(# u upi u upi u upi u upi )/zRUse host facts and compare to the cluster type to modify the sos
command if neededr"   rÍ   rØ   z
--threads=z3.7z--plugin-timeout=z3.8z--allow-system-changesz--no-env-varsz--since=z4.1z--skip-commands=rÿ   z--skip-files=z4.2z--cmd-timeout=z4.3z4.2-13r^   z--container-runtime=z--namespaces=z4.5.2z--journal-size=z--low-priorityr#   z--r„   rÓ   rn   z-k c              3   ó$   "  € T F  qx € K  	  R # 5ir  r;  )r  rR  s   & rT   r  Ú+SosNode.finalize_sos_cmd.<locals>.<genexpr>ª  s   é € Ð4EÁ¸1´QÃùs   ‚z	--preset=zRequested to enable preset z" but preset does not exist on nodezRequested plugins z. were requested to be enabled but do not existz--only-plugins=zFinal sos command set to rƒ   NzRequested to skip plugins z%, but plugins are already not enabledz--skip-plugins=zRequested to enable plugins z1, but plugins are already enabled or do not existz--enable-plugins=)0r;   Údetermine_sos_labelr   rà   r*   Úthreadsrí   ÚstrÚplugin_timeoutÚallow_system_changesÚno_env_varsÚsinceÚskip_commandsrÝ   Ú
skip_filesÚcmd_timeoutÚcontainer_runtimeÚ
namespacesÚjournal_sizeÚlow_priorityre  Úreplacero   r�   r.   Úsos_bin_pathr<   r   r_  rB  rs   rN  r5  r6  r�   ri  rÞ   rh  ÚsetrT  r"   rœ   r…   r†   rj  rE  rK  rH  )rP   r"   ÚlabelÚsos_optsrL  rv   rR  r*   ÚplugsÚnot_onlyÚonlyÚskipÚnot_skipÚskiplnÚnot_onÚenables   &               rT   Úfinalize_sos_cmdÚSosNode.finalize_sos_cmdY  s›  € ð —-‘- 	Õ*ˆØ×(Ñ(Ó*ˆßØ ˜	 ¤5¨£< .°Ð2ˆGàˆð ×!Ñ! %×(Ò(à�y‰y× Ñ  AÔ%Ø—‘ *¬U´3°t·y±y×7HÑ7HÓ3IÓ-JÐ,KÐ LÔMð ×!Ñ! %×(Ò(Ø�y‰y×'×'Ð'Ø—‘Ø'¬¬c°$·)±)×2JÑ2JÓ.KÓ(LÐ'MÐNôPð ×!Ñ! %×(Ò(Ø�y‰y×-×-Ð-Ø—‘Ð 8Ô9à�y‰y×$×$Ð$Ø—‘ Ô0à�y‰y��ˆØ—‘ (¬5°·±·±Ó+AÐ*BÐ CÔDà×!Ñ! %×(Ò(Ø�y‰y×&×&Ð&Ø—‘Ð 2Ü#(¨¯©°$·)±)×2IÑ2IÓ)JÓ#KÐ"Lð!Nô Oà�y‰y×#×#Ð#Ø—‘Ø#¤E¨#¯(©(°4·9±9×3GÑ3GÓ*HÓ$IÐ#JÐKôð ×!Ñ! %×(Ò(Ø�y‰y×$×$Ð$Ø—‘Ø$¤U¬3¨t¯y©y×/DÑ/DÓ+EÓ%FÐ$GÐHôð
 ×!Ñ! %×(Ò(¨D×,BÑ,BÀ8×,LÒ,LØ�y‰y×*Ñ*¨fÔ4Ø—‘Ø*¨4¯9©9×+FÑ+FÐ*GÐHôð �y‰y×#×#Ð#Ø—‘Ø# D§I¡I×$8Ñ$8Ð#9Ð:ôð ×!Ñ! '×*Ò*Ø�y‰y×%×%Ð%Ø—‘ /°$·)±)×2HÑ2HÐ1IÐ JÔKØ�y‰y×%×%Ð%Ø—‘Ð 0Ô1à×$Ñ$Ô&à—/‘/ØÜ�G‰G�L‰L˜Ÿ™×/Ñ/°·±Ó>ó
ˆð
 ×#Ô#ˆCØ×#Ñ# CÕ(ˆDØ�O‰O˜b   Q¯t¡t¸Ð&<Ð=Ö>ñ $ð �=�=ˆ=Ø#Ÿ}š}ó E™}˜!Ø×*Ñ*¨1¯7©7°3«<¸­?×;ô à×2Ñ2°1·7±7¸3³<Àµ?×C÷ �A™}ˆDð E÷ Ø—‘ #¤e¨C¯H©HÑ4EÁÓ4EÓ,EÓ&FÐ%GÐ HÔIà�;�;ˆ;Ø×"Ñ" 4§;¡;×/Ò/Ø—‘ )¬E°$·+±+Ó,>Ð+?Ð @ÕAà—‘Ð!<¸T¿[¹[¸Mð J?ð  ?ô @ð ××ÑØ $× 1Ò 1ÓLÑ 1˜1×5HÑ5HÈ×5K—Q�QÑ 1ˆEÐLÜ�5‹zœS ×!2Ñ!2Ó3Ô3Ü¤ D×$5Ñ$5Ó 6¼¸U»Õ CÓD�Ø—‘Ð!3°H°:ð >@ð  @ô Aà×)Ñ)¨$×*;Ñ*;Ó<ˆDßØ—‘ /´%¸³+°Ð ?Ô@Ø%˜Y a¨¯©°Ó(:Ð';Ð<ˆDŒLØ�M‰MÐ5°d·l±l°^ÐDÔEØ�M‰M×#Ñ#Ð$7¸¿¹ÔFÙà××Ðà#×0Ò0ÓKÑ0˜!×4GÑ4GÈ×4J—A�AÑ0ˆDÐKÜ�4‹yœC × 1Ñ 1Ó2Ô2Ü¤ D×$5Ñ$5Ó 6¼¸T»Õ BÓC�Ø—‘Ð!;¸H¸:ð FAð  Aô Bà×+Ñ+¨DÓ1ˆFßØ—‘ /´%¸³-°Ð AÔBà××Ðà#×2Ò2ó LÑ2˜!Ø× 1Ñ 1Ñ1ô à×,Ñ,¨Q×/ô à48×4GÑ4GÈ×4J÷ �AÑ2ˆDð Lô �4‹yœC × 3Ñ 3Ó4Ô4Üœc $×"5Ñ"5Ó6¼¸T»ÕBÓC�Ø—‘Ð!=¸f¸Xð FMð  Mô Nà×+Ñ+¨DÓ1ˆFßØ—‘Ð"3´E¸&³M°?Ð CÔDà!˜ ! C§H¡H¨XÓ$6Ð#7Ð8ˆŒØ�‰Ð1°$·,±,°Ð@ÔAØ�‰×ÑÐ 3°T·\±\ÖBùòkEùò Mùò LùòLsB   Ô/gÕ*gÕ7gÙgÙ2gÞ!gÞ>gâgâgâ2gãgc                óÌ  € RpWP                   P                  V 4      ,          pV P                  P                  '       d?   Y'       g   V P                  P                   MRV P                  P                   2,          pV'       g   R# V P	                  RV 24       V P                  R4      '       d   RpM)RpV P                  P                  R4      ^ ,           RV 2pV R	V 2# )
z?Determine what, if any, label should be added to the sos reportr„   r×   NzLabel for sos report set to rØ   z--labelz--namerÓ   rn   )r/   Úget_node_labelr*   r€  r�   rà   r(   rs   )rP   r€  Úlcmds   &  rT   ro  ÚSosNode.determine_sos_labelÝ  sÄ   € àˆØ—‘×,Ñ,¨TÓ2Õ2ˆà�9‰9�?�?ˆ?Ø¶%˜Ÿ™Ÿ™Ñ)Ø˜tŸy™yŸ™Ð/Ð0õ2ˆE÷ Ùà�‰Ð5°e°WÐ=Ô>Ø×!Ñ! %×(Ò(Ø‰DàˆDØ—|‘|×)Ñ)¨#Ó.¨qÕ1Ð2°!°E°7Ð;ˆEØ��q˜˜Ð Ð rZ   c                óN  € V P                   P                  pV'       d   VP                  VR4      pVP                  4       ^ ,          pV P	                  RV 24       Wn        VP                  R4      R,          V n        V P                  P                  RV P                  4       R# )zTUse host facts to determine if we need to change the sos path
we are retrieving fromr„   zFinal sos path: rz   Úcollected_archiveNr|   )	r.   Úsos_path_stripr}  rs   rœ   r7   Úarchiver…   r†   )rP   r�   Úpstrips   && rT   r/  ÚSosNode.finalize_sos_pathñ  s{   € ð —‘×)Ñ)ˆßØ—<‘< ¨Ó+ˆDØ�z‰z‹|˜A�ˆØ�‰Ð(¨¨Ð/Ô0ØŒØ—z‘z #“ rÕ*ˆŒØ�‰×ÑÐ 3°T·\±\ÖBrZ   c                ó    € VR8X  d   R# V^8X  d
   RV9   d   R# V^8X  d   R# \        V4      ^ 8”  d   VP                  R4      R,          # RV 2# )	é   z+sos report process received SIGKILL on noder{   zsudo attempt failedz4sos report terminated unexpectedly. Check disk spaceÚ
:r   r—  Nzsos exited with code r|   )rÞ   rs   )rP   ÚrcÚstdouts   &&&rT   Údetermine_sos_errorÚSosNode.determine_sos_errorý  sT   € Ø�Œ8Ù@Ø�Œ7Ø˜ÔÙ,Ø�Œ9ÙIÜˆv‹;˜Œ?Ø—<‘< Ó% cÕ*Ð*Ø& r dÐ+Ð+rZ   c           	     óà  € V P                  R4        RpRpRpV P                  P                  '       d   RV P                  P                   2pM£V P                  P                  '       dˆ   V P                  '       g]   RV P
                  P                  R4      R,           R2pV P                  P                  V P                  P                  V4       RV 2pMRV P                  P                   2pV'       d   V P                   RV 2V n
        V P                  V P                  V P                  P                  R	R	R	V P                  R
7      pVR,          ^ 8X  Edk   VR,          P                  4        F‘  p\        P                  ! VR4      '       d   VP!                  4       pVP#                  R4      '       d   VP                  R4      ^,          pKa  VP#                  R4      '       g   Kz  VP                  4       ^,          pK“  	  V'       d˜   V P$                  P'                  RV4       \)        V4      ^ 8X  d   V P$                  P'                  RR4       V# \)        V4      ^@8X  d   V P$                  P'                  RR4       V# V P$                  P'                  RR4        V# V P$                  P'                  RR4        V# V P+                  VR,          VR,          4      pV P-                  RVR,           RVR,           24       \/        V4      h  \0         d    T P3                  R4       h \.         d/   pT P5                  RT 24       T P                  RT 24       h Rp?ii ; i)z2Run sos report and capture the resulting file pathzGenerating sos report...Fr„   z--config-file=z/tmp/rz   z.confrÍ   T)r'  r(  r—   rÖ   r)  rk   rl   z*sosreport-*tar*Ú	zThe checksum is: ÚchecksumÚchecksum_typeÚmd5Úsha256ÚunknownzError running sos report. rc = z msg = zTimeout exceededz'Exception during sos report execution: zError running sos report: Nr|   )z sha256	z md5	)r¹   r*   r,   r-   r   r   rs   rB   Úcopy_file_to_remoteÚconfig_filer"   rr   r'  r1   rë   Úfnmatchr'   rì   r…   r†   rÞ   r›  r�   rE   r   rF   rœ   )rP   r�   rŸ  Úconfig_file_argÚremote_configrŸ   rî   rS   s   &       rT   r.  ÚSosNode.execute_sos_command	  sï  € à�‰Ð.Ô/ð7	ØˆDØˆHØ ˆOØ�y‰y×)×)Ð)Ø$2°4·9±9×3MÑ3MÐ2NÐ"O‘Ø—‘×.×.Ð.Ø—z—z�zØ&+¨D¯K©K×,=Ñ,=¸cÓ,BÀ2Õ,FÐ+GÀuÐ$M�MØ—O‘O×7Ñ7ØŸ	™	×-Ñ-Ø%ô'ð )7°}°oÐ&F‘Oð )¨¯©×)>Ñ)>Ð(?Ð@ð $çØ"&§,¡, ¨q°Ð0AÐB�”Ø×"Ñ" 4§<¡<Ø+/¯9©9×+<Ñ+<Ø-1Ø-1Ø15Ø'+×'8Ñ'8ð #ó :ˆCð �8�} Õ!Ø �M×4Ñ4Ö6�DÜ—’ tÐ-?×@Ò@Ø#Ÿz™z›|˜Ø—‘Ð'>×?Ò?Ø#'§:¡:¨dÓ#3°AÕ#6šØŸ™Ð)<×=Ô=Ø#'§:¡:£<°¥?šñ 7÷ Ø—M‘M×+Ñ+¨J¸ÔAÜ˜8“}¨Ô*ØŸ™×/Ñ/°ÀÔGð ˆKô ˜X›¨"Ô,ØŸ™×/Ñ/°ÀÔJð ˆKð Ÿ™×/Ñ/°ÀÕKð ˆKð —M‘M×+Ñ+¨O¸YÕGð ˆKð	 ×.Ñ.¨s°8­}¸cÀ(½mÓL�Ø—‘Ð@Ø"% h¥- °¸¸H½°ð Hô Iä “nÐ$øä&ô 	Ø�N‰NÐ-Ô.ØÜô 	Ø�M‰MÐCÀCÀ5ÐIÔJØ�K‰KÐ4°S°EÐ:Ô;Øûð	ús\   “!L µ5L Á+L Á=A<L Ã:C0L Ç/"L ÈA	L É-L Ê
L Ê)L ËAL Ì%M-Ì>M-Ì?)M(Í(M-c                ó´  € V P                   R,           p\        P                  P                  W!P	                  R4      R
,          4      p V P                  V4      '       d3   V P                  RV RV 24       V P                  P                  W4      # V P                  RV R24       R#   \         d#   pT P                  RT RT 24        R	p?R# R	p?ii ; i)z7Copies the specified file from the host to our temp dirrz   zCopying remote z
 to local zAttempting to copy remote file ú%, but it does not exist on filesystemFzFailed to retrieve r  Nr|   )r   ro   r�   rÝ   rs   r­   rœ   rB   Úretrieve_filer�   rE   )rP   r�   ÚdestdirÚdestrS   s   &&   rT   r¬  ÚSosNode.retrieve_fileE  sÁ   € à—+‘+ Õ#ˆÜ�w‰w�|‰|˜G§Z¡Z°£_°RÕ%8Ó9ˆð		Ø×Ñ ×%Ò%Ø—‘ °¨v°ZÀ¸yÐIÔJØ—‘×4Ñ4°TÓ@Ð@Ø�N‰NÐ<¸T¸Fð C;ð ;ô <áøÜô 	Ø�N‰NÐ0°°°b¸¸Ð>Ô?Ýûð	ús   Á
AB* ÂB* Â*CÂ5CÃCc                óÚ  € RP                  VP                  4       4      p \        VP                  R4      4      ^8:  d   V P                  RV R24       R# V P	                  V4      '       d9   V P                  RV 24       RV 2pV P                  VRR	7      pVR
,          ^ 8H  # V P                  RV R24       R#   \         d#   pT P                  RT RT 24        Rp?R# Rp?ii ; i)zlRemoves the spciefied file from the host. This should only be used
after we have retrieved the file already
r„   rz   zRefusing to remove path z0: appears to be incorrect and possibly dangerousFzRemoving file zrm -f Tr–   rk   z!Attempting to remove remote file r«  zFailed to remove r  N)rÝ   rs   rÞ   r�   r­   rœ   rr   rE   )rP   r�   rž   rŸ   Úes   &&   rT   Úremove_fileÚSosNode.remove_fileT  s÷   € ð �w‰w�t—z‘z“|Ó$ˆð	Ü�4—:‘:˜c“?Ó# qÔ(Ø—‘Ð!9¸$¸ð @Eð  Eô FáØ×Ñ ×%Ò%Ø—‘ ¨t¨fÐ5Ô6Ø˜t˜f�o�Ø×&Ñ& s°dÐ&Ó;�Ø˜8•}¨Ñ)Ð)Ø�N‰NÐ>¸t¸fð E=ð =ô >áøÜô 	Ø�N‰NÐ.¨t¨f°B°q°cÐ:Ô;Ýûð	ús)   ¡4B= ÁB= Á.7B= Â&B= Â=C*ÃC%Ã%C*c                ó˜  € V P                   '       g   V P                  P                  '       d    V P                  V P                  4       V P                  RV P                   24       V P                  R4        V P                  V P                  4      pT'       dO   T P                  R4       T P                  P                  T P                  P                  R4      R
,          4       R# T P                  R	4       R#   \
         d    T P                  R4        R# i ; i  \
         d   pT P                  T4        Rp?R# Rp?ii ; i)z,Collect the sos report archive from the nodezFailed to make archive readableFzRetrieving sos report from zRetrieving sos report...Nz!Successfully collected sos reportrz   TzFailed to retrieve sos reportr|   )r   r*   rÎ   Úmake_archive_readabler7   rE   rF   rœ   r(   r¹   r¬  r:   rí   rs   )rP   rt   rS   s   &  rT   r0  ÚSosNode.retrieve_sosreportj  sý   € à�>�>ˆ>˜TŸY™Y×2×2Ð2ðØ×*Ñ*¨4¯=©=Ô9ð 	�‰Ð3°D·L±L°>ÐBÔCØ�‰Ð.Ô/ð	Ø×$Ñ$ T§]¡]Ó3ˆC÷ Ø�K‰KÐ;Ô<Ø�N‰N×!Ñ! $§-¡-×"5Ñ"5°cÓ":¸2Õ">Ô?ÙØ�‰Ð3Ô4Ùøô ô Ø—‘Ð@ÔAÚðûô ô 	Ø�N‰N˜3ÔÝûð	ús)   °C? Á;D" Ã?DÄDÄ"E	Ä-EÅE	c                ó  € V P                   e   V P                  '       d   R# RV P                   9  d"   V P                  RV P                    R24       R# V P                  V P                   4      pV'       g   V P	                  R4       R# R# )znRemove the sos report archive from the node, since we have
collected it and it would be wasted space otherwiseNr#   zNode sos report path z/ looks incorrect. Not attempting to remove pathzFailed to remove sos report)r7   r   r�   r²  rF   )rP   Úremoveds   & rT   Úremove_sos_archiveÚSosNode.remove_sos_archive€  sx   € ð �=‰=Ò  D§J§J Jñ Ø˜dŸm™mÔ+Ø�N‰NÐ2°4·=±=°/ð BFð Fô GáØ×"Ñ" 4§=¡=Ó1ˆßØ�N‰NÐ8Ö9ñ rZ   c                ó  € V P                  4        V P                  '       d4   R F-  pV P                  V P                  V,           4      '       g   K-   M	  V P                  P	                  4       pV'       d   V P                  VRR7       R# R# )z<Remove the sos archive from the node once we have it locallyTr–   N)z.sha256z.md5)r¹  r7   r²  r.   Úset_cleanup_cmdrr   )rP   Úextr1  s   &  rT   r1  ÚSosNode.cleanup�  sm   € à×ÑÔ!Ø�=�=ˆ=Û*�Ø×#Ñ# D§M¡M°CÕ$7×8Ô8Ùñ +ð —)‘)×+Ñ+Ó-ˆßØ×Ñ˜W°ÐÖ5ñ rZ   c                ód  € V Fµ  p V P                   '       g   V P                  P                  '       d    V P                  V4       V P                  V4      pV'       dE   V P                  P                  VP                  R4      R,          4       V P                  V4       K¡  V P                  RV 24       K·  	  R#   \         d7   pT P                  RT 24       T P                  RT RT 24        Rp?K÷  Rp?ii ; i  \         d#   pRT 2pT P                  T4        Rp?EK'  Rp?ii ; i)z4Collect the file created by a cluster outside of soszUnable to retrieve file zFailed to make file z readable: Nrz   z/Error collecting additional data from primary: r|   )r   r*   rÎ   rµ  rE   rF   r�   r¬  r:   rí   rs   r²  )rP   Ú	filenamesÚfilenamerS   rt   r±  rg   s   &&     rT   Úcollect_extra_cmdÚSosNode.collect_extra_cmdš  s  € ã!ˆHð$Ø—>—>�> T§Y¡Y×%:×%:Ð%:ð!Ø×2Ñ2°8Ô<ð ×(Ñ(¨Ó2�ßØ—N‘N×)Ñ)¨(¯.©.¸Ó*=¸bÕ*AÔBØ×$Ñ$ XÖ.à—N‘NÐ%=¸h¸ZÐ#HÖIó "øô
 %ô !ØŸ™Ð)AÀ(ÀÐ'LÔMØŸ™Ð)=¸h¸Zð H4Ø47°5ð(:ô ;å ûð	!ûô ô $ØGÈÀsÐK�Ø—‘˜s×#Ó#ûð$úsM   ‡-D¶B>ÁDÁ ADÂ$DÂ>C?Ã	+C:Ã4DÃ:C?Ã?DÄD/ÄD*Ä*D/c                ó¤   € RV 2pV P                  V^
RR7      pVR,          ^ 8X  d   R# RpV P                  WAVR,          3,          4       \        h)z¤Used 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 T)r'  r—   rk   z6Exception while making %s readable. Return code was %s)rr   rF   rE   )rP   Úfilepathrž   rŸ   rg   s   &&   rT   rµ  ÚSosNode.make_archive_readable°  sX   € ð ˜8˜*Ð%ˆØ×Ñ˜s¨B¸$ÐÓ?ˆØˆx�=˜AÔÙØFˆØ�‰�s¨¨H­Ð6Õ6Ô7ÜˆrZ   )#r2   r4   rH   rB   r(   r“  r/   r)   rJ   rK  r:   r9   r.   r   r0   r-   r   r…   r   r,   ri  r*   r_  r5  r8   rj  r<   r"   r1   r;   r   r7   r?   r   r@   )NNT)F)é´   r^   FFN)9Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rU   ÚpropertyrJ   rK   rA   rh   rw   r}   r‰   rL   rN   r™   r­   re   rµ   r¹   rœ   rF   r�   rÐ   rO   râ   rá   ró   r  rG   rà   r!  rr   r#   r6  rB  rE  rH  rN  rT  rW  re  r+   rŠ  ro  r/  r›  r.  r¬  r²  r0  r¹  r1  rÂ  rµ  Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @rT   r   r   *   sP  ø‡ € ôDðL ñó ðò%ò
8ò"?ð ñó ðð ñ!ó ð!òCò
ò&òP
ôð ñó ðò
3ò-òò òòò2òh;òPô"òò'ò$ò$Fô&6òPò2òEò
2ò3òò"Cò
ò&4òP	-òBCòH!ò(
Cò
,ò:òxòò,ò,:ò	6ò$÷,ð rZ   r   )r¦  r¿   r=   ro   r²   Úshlexr   Úsos.policiesr   Úsos.policies.init_systemsr   Úsos.collector.transports.jujur   Ú(sos.collector.transports.control_persistr   Úsos.collector.transports.localr   Úsos.collector.transports.ocr	   Ú"sos.collector.transports.saltstackr
   Úsos.collector.exceptionsr   r   r   r   Úsos.utilitiesr   ra   r   r;  rZ   rT   Ú<module>rÚ     sn   ðó Û Û Û 	Û 	å Ý Ý 0Ý 1Ý FÝ 9Ý 3Ý >÷Aó Aõ ,ð ˆ^ØÐ(Øˆ+Ø�Ø
ˆGð€
÷Ró RrZ   