+
    Ùe¼iC  ã                   óÎ   € R t ^ RIt^ RIt^ RIHt ^ RIHtHt ^ RIH	t	 ^ RI
HtHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHtHt . ROtR
 R lt ! R R]4      tRR ltRR ltRR ltR# )z%Deployment code for the sysinfo tool.N)ÚArgumentTypeError)Ú	FormatterÚ	getLogger)ÚRotatingFileHandler)ÚDeferredÚmaybeDeferred)Ú
namedClass)ÚVERSION)ÚBaseConfiguration)ÚSysInfoPluginRegistryÚformat_sysinfoc                óF   € V ^8„  d   QhR\         R\        \         ,          /# )é   ÚstringÚreturn)ÚstrÚlist)Úformats   "Ú>/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.pyÚ__annotate__r      s   € ÷ ñ œð ¤¤S¥	ñ ó    c                ó  € V P                  R4       Uu. uF  qP                  4       NK  	  pp. p. pV F2  pV\        9   d   VP                  V4       K!  VP                  V4       K4  	  V'       d   \	        V4      hV# u upi )za
Parser for converting a comma separated string of plugin names
to a list of those plugin names.
Ú,)ÚsplitÚstripÚALL_PLUGINSÚappendr   )r   ÚpluginÚpluginsÚvalid_pluginsÚinvalid_pluginss   &    r   Úplugin_listr!      sz   € ð
 -3¯L©L¸Ô,=Ó>Ñ,= &�|‰|Ž~Ñ,=€GÐ>Ø€MØ€OÛˆØ”[Ô Ø× Ñ  Ö(à×"Ñ" 6Ö*ñ	 ÷ Ü Ó0Ð0ØÐùò ?s   ”A?c                   óÊ   a a€ ] tR t^.t oRt]tR	t]P                  ! 4       ^ 8w  d$   ]]P                  P                  R4      3,          tRtRtV 3R ltV 3R ltR tRtVtV ;t# )
ÚSysInfoConfigurationz9Specialized configuration for the Landscape sysinfo tool.z~/.landscape/sysinfo.confz/var/lib/landscape/client/Úsysinfoc                óB   <€ \         SV `  4        R V P                  R&   R # )NÚconfig)ÚsuperÚ__init__Ú_command_line_defaults)ÚselfÚ	__class__s   &€r   r(   ÚSysInfoConfiguration.__init__:   s   ø€ Ü‰ÑÔà04ˆ×#Ñ# HÓ-r   c                ó  <€ \         SV `  4       pVP                  RRR\        R7       VP                  RRR\        R7       VP                  R\        ^PRR	7       R
P                  RP                  \        4      4      Vn        V# )zO
Specialize L{Configuration.make_parser}, adding any
sysinfo-specific options.
z--sysinfo-pluginsÚPLUGIN_LISTzNComma-delimited list of sysinfo plugins to use. Default is to use all plugins.)ÚmetavarÚhelpÚtypez--exclude-sysinfo-pluginszhComma-delimited list of sysinfo plugins to NOT use. This always take precedence over plugins to include.z--widthz(Maximum width for each column of output.)r1   Údefaultr0   zDefault plugins: {}z, )	r'   Úmake_parserÚadd_argumentr!   Úintr   Újoinr   Úepilog)r*   Úparserr+   s   & €r   r3   Ú SysInfoConfiguration.make_parser?   s›   ø€ ô
 ‘Ñ$Ó&ˆà×ÑØØ!ð2äð 	ô 	
ð 	×ÑØ'Ø!ð"ô ð 	ô 	
ð 	×ÑØÜØØ;ð	 	ô 	
ð .×4Ñ4°T·Y±Y¼{Ó5KÓLˆŒØˆr   c           	     ó,  € V P                   f   \        pMV P                   pV P                  f   . pMV P                  pV Uu. uF  q3V9  g   K  VNK  	  ppV Uu. uF'  p\        RVP	                  4        RV 24      ! 4       NK)  	  up# u upi u upi )Nzlandscape.sysinfo.Ú.)Úsysinfo_pluginsr   Úexclude_sysinfo_pluginsr   Úlower)r*   ÚincludeÚexcludeÚxr   Úplugin_names   &     r   Úget_pluginsÚ SysInfoConfiguration.get_pluginsa   s©   € Ø×ÑÒ'Ü!‰Gà×*Ñ*ˆGØ×'Ñ'Ò/Ø‰Gà×2Ñ2ˆGÙ%Ó:™g˜°'Ñ)9—1�1™gˆÐ:ñ
  'ó	
ñ  '�ô Ø$ [×%6Ñ%6Ó%8Ð$9¸¸;¸-ÐHôö ñ  'ñ	
ð 	
ùò ;ùò
s   ÁBÁBÁ-B© )z/etc/landscape/client.conf)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r	   ÚversionÚdefault_config_filenamesÚosÚgetuidÚpathÚ
expanduserÚdefault_data_dirÚconfig_sectionr(   r3   rC   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r+   Ú__classdict__s   @@r   r#   r#   .   s_   ù‡ € ÙCà€Gà>ÐØ	‡y‚yƒ{�aÔØ  R§W¡W×%7Ñ%7Ð8SÓ%TÐ$VÕVÐ Ø3Ðà€Nõ5õ
 ÷D
ò 
r   r#   c                óˆ   € V f>   \         P                  ! 4       ^ 8X  d   Rp V # \         P                  P                  R4      p V # )zg
Work out the correct path to store logs in depending on the effective
user id of the current process.
z/var/log/landscapez~/.landscape)rM   rN   rO   rP   )Úlandscape_dirs   &r   Úget_landscape_log_directoryrY   s   sA   € ð
 ÒÜ�9Š9‹;˜!ÔØ0ˆMð Ðô ŸG™G×.Ñ.¨~Ó>ˆMØÐr   c                 óh  € \        V 4      p \        R 4      pRVn        \        P                  P                  V 4      '       g   \        P                  ! V 4       \        P                  P                  V R4      p\        VR^R7      pVP                  V4       VP                  \        R4      4       R# )zlandscape-sysinfoFzsysinfo.log)ÚmaxBytesÚbackupCountz'%(asctime)s %(levelname)-8s %(message)sNi Ð )rY   r   Ú	propagaterM   rO   ÚisdirÚmkdirr6   r   Ú
addHandlerÚsetFormatterr   )rX   ÚloggerÚlog_filenameÚhandlers   &   r   Úsetup_loggingre   €   s‰   € Ü/°Ó>€MÜÐ*Ó+€FØ€FÔÜ�7‰7�=‰=˜×'Ò'Ü
�Š�ÔÜ—7‘7—<‘< ¨}Ó=€LÜ!ØØØô€Gð
 ×Ñ�gÔØ×ÑœÐ#LÓMÖNr   c                óô  aaaaaa	€  \        4        Sf   \	        4       o\        4       oSP                  V RR7       SP                  4        F  pSP                  V4       K  	  VV3R lo	V	V3R loSeJ   \        4       oSP                  VV3R l4       V3R lpSP                  V4       SP                  4        S# S! 4       oS#   \         d$   p\        P                  ! RT 24        Rp?LàRp?ii ; i)	zI
@param reactor: The reactor to (optionally) run the sysinfo plugins in.
zUnable to setup logging. NT)Ú!accept_nonexistent_default_configc           
      ó¢   <€ \        \        SP                  4       SP                  4       SP	                  4       SP
                  R R7      4       R# )z  )ÚwidthÚindentN)Úprintr   Úget_headersÚ	get_notesÚget_footnotesri   )Úresultr&   r$   s   &€€r   Úshow_outputÚrun.<locals>.show_output¢   sA   ø€ ÜÜØ×#Ñ#Ó%Ø×!Ñ!Ó#Ø×%Ñ%Ó'Ø—l‘lØôö	
r   c                  óB   <€ SP                  4       P                  S 4      # ©N)ÚrunÚaddCallback)rp   r$   s   €€r   Úrun_sysinfoÚrun.<locals>.run_sysinfo­   s   ø€ Ø�{‰{‹}×(Ñ(¨Ó5Ð5r   c                  ó8   <€ \        S4      P                  S 4      # rs   )r   ÚchainDeferred)Údonerv   s   €€r   Ú<lambda>Úrun.<locals>.<lambda>¶   s   ø€ ”M +Ó.×<Ñ<¸TÔBr   c                 ó@   <€ SP                  ^ SP                  4       V # )é    )Ú	callLaterÚstop)ro   Úreactors   &€r   Ústop_reactorÚrun.<locals>.stop_reactor¹   s   ø€ ð ×Ñ˜a §¡Ô.ØˆMr   )re   ÚOSErrorÚsysÚexitr   r#   ÚloadrC   Úaddr   ÚcallWhenRunningÚaddBothrt   )
Úargsr�   r$   Úer   r‚   r&   rz   rv   rp   s
   &ff   @@@@r   rt   rt   �   sÜ   ý€ ð2ÜŒð ‚Ü'Ó)ˆÜ!Ó#€Fð ‡K�K�¸€KÔ=Ø×$Ñ$Ö&ˆØ�‰�FÖñ 'ö	
ö6ð Òô ‹zˆØ×ÑÝBô	
õ	ð 	�‰�\Ô"Ø�‰Œð €Kñ ‹}ˆØ€Køô[ ô 2Ü�ŠÐ,¨Q¨CÐ0×1Ñ1ûð2ús   ˆ
C	 Ã	C7ÃC2Ã2C7)ÚLoadÚDiskÚMemoryÚTemperatureÚ	ProcessesÚLoggedInUsersÚNetworkrs   )NN)rJ   rM   r…   Úargparser   Úloggingr   r   Úlogging.handlersr   Útwisted.internet.deferr   r   Útwisted.python.reflectr   Ú	landscaper	   Úlandscape.lib.configr
   Úlandscape.sysinfo.sysinfor   r   r   r!   r#   rY   re   rt   rE   r   r   Ú<module>rœ      sR   ðÙ +ã 	Û 
Ý &ß (Ý 0ç :Ý -å Ý 2ß Kò€õô&B
Ð,ô B
ôJ
ôOö 3r   