+
    i  c                   sF    ^ RI Ht ^ RIHt ^ RIHtHt  ! R R]]4      tR# )i    )match)quote)PluginRedHatPluginc                   sR   a  ] tR t^t o RtRtRtRtRtRt	Rt
R tR	R ltR tRtV tR# )
	Candlepinz Candlepin entitlement management	candlepinNc                s   R V n         RV n        RV n        Rp \        VRRR7      ;_uu_ 4       pVP	                  4       P                  4       pRRR4       X F  pV'       d   V^ ,          R8X  d   K  \        R	V4      '       dZ   VP                  R
4      ^,          P                  R4      ^,          P                  R4      pV^ ,          V n         V^,          V n        \        RV4      '       g   K  VP                  R
4      ^,          V n        K  	  V P                  RRRRRR/4       RV P                  /V n        V P                  RR.^ R7       V P                  . RO4       V P                  R4       V P                  R4      pV P                  VRV P                  R7       V P                  R4      pV P                  VRV P                  R7       R#   + '       g   i     EL; i  \        \        3 d     Li ; i)Z	localhosti8   /etc/candlepin/candlepin.confZrzUTF--8)ZencodingNZ#z&^\s*org.quartz.dataSource.myDS.URL=\S+Z=Z/Z:z+^\s*org.quartz.dataSource.myDS.password=\S+z"/var/log/candlepin/candlepin.log.*Zcandlepin_logz/var/log/candlepin/err.log.*Zcandlepin_error_logZcandlepin_confZ
PGPASSWORDz/var/log/candlepin/error.logz /var/log/candlepin/candlepin.log)Z	sizelimitzdu -sh /var/lib/candlepin/*/*a[  SELECT table_name, pg_size_pretty(total_bytes) AS total, pg_size_pretty(index_bytes) AS INDEX , pg_size_pretty(toast_bytes) AS toast, pg_size_pretty(table_bytes) AS TABLE FROM ( SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM (SELECT c.oid,nspname AS table_schema, relname AS TABLE_NAME, c.reltuples AS row_estimate, pg_total_relation_size(c.oid) AS total_bytes, pg_indexes_size(c.oid) AS index_bytes, pg_total_relation_size(reltoastrelid) AS toast_bytes FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE relkind = 'r') a) a order by total_bytes DESCZcandlepin_db_tables_sizes)Zsuggest_filenameenvzN            SELECT displayname, content_access_mode             FROM cp_owner;Zsimple_content_access)r   /etc/candlepin/broker.xmlz/var/log/candlepin/audit*.log*z%/var/log/candlepin/candlepin.log[.-]*z/var/log/candlepin/cpdb*.log*z/var/log/candlepin/cpinit*.log*z!/var/log/candlepin/error.log[.-]*z/var/log/tomcat*/catalina*log*z"/var/log/tomcat*/host-manager*log*z/var/log/tomcat*/localhost*log*z/var/log/tomcat*/manager*log*)dbhostdbportdbpasswdZopenZreadZ
splitlinesr    ZsplitZIOErrorZ
IndexErrorZadd_file_tagsr   Zadd_copy_specZadd_cmd_outputbuild_query_cmd)selfZcfg_fileZcfileZcandle_linesZlineZjdbcurlZ_cmds   &      A/usr/lib/python3.14/site-packages/sos/report/plugins/candlepin.pysetupZCandlepin.setup   s    "2	hh775$zz|668 8$tAw#~BDII #jjoa066s;A>DDSIG")!*DK")!*DKGNN$(JJsOA$6DM %  	0/*,A+-=
 	 !$--0 	*.
  	 	 	 
 	" 	;<##
 	D3N $ 	 	* ## %  	D-D $ 	 	*Y 877 $ 		s/   G* GBG* 2!G* G'	!	G* *G>=G>c                sp    V'       d   RMRpRpW@P                   V P                  V\        V4      3,          # )a  
Builds the command needed to invoke the pgsql query as the postgres
user.
The query requires significant quoting work to satisfy both the
shell and postgres parsing requirements. Note that this will generate
a large amount of quoting in sos logs referencing the command being run
z
-A -F , -Xr   zSpsql --no-password -h %s -p %s -U candlepin                   -d candlepin %s -c %s)r
   r   r   )r   ZqueryZcsvZ	csvformatZ_dbcmds   &&&  r   r   ZCandlepin.build_query_cmdw   s2     %(LR	)dkk9eElKKK    c                s    R pRpV P                  RW4       RpV P                  RW24       R
 F  pV P                  RRV R2R4       K  	  R	# )z$(((.*)(pass|token|secret)(.*))=)(.*)z
\1********r   z(--password=)([a-zA-Z0-9]*)z/var/log/candlepin/cpdb.logr	   Z(z)=(\w*)([;<])z\1=********\3N)ZtrustStorePasswordZkeyStorePassword)Zdo_file_sub)r   ZregZreplZcpdbregZkeys   &    r   postprocZCandlepin.postproc   s]    58#D06F=C8 !#m4-/ >r   )r
   r   r   r   )r   )F)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z
short_descZplugin_nameZpackagesr
   r   r   r   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      s?     3JKHFFH
CY*vL	/ 	/r   r   N)Zrer    Zshlexr   Zsos.report.pluginsr   r   r   ) r   r   <module>r      s       3}/ }/r   