+
    eiC                         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    
 -3LL,=>,=&||~,=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4TYY{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2G%:g')911g:
  '	
  ' $[%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>	yy{a RWW%7%78S%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    
 99;!0M  GG..~>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77==''
77<<}=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?LR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    ##%!!#%%'ll	
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 KKK=$$&F '	
6  zB	
	 	\" K }K[  2,QC0112s   
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   