Current File : //lib/python2.7/site-packages/sos/plugins/candlepin.pyc
�
u��ec@sSddlmZmZddlmZddlmZdeefd��YZdS(i����(tPlugintRedHatPlugin(tquote(tmatcht	CandlepincBs8eZdZdZdZd�Zed�Zd�ZRS(s Candlepin entitlement managementt	candlepincCs�d|_d|_d}y�x�t|�j�j�D]�}|s4|ddkrWq4ntd|�r�|jd�d|_|jjd	�d
jd�d|_ntd|�r4|jd�d|_q4q4WWnttfk
r�nXi|jd
6|_	|j
ddgdd�|j
ddddddg�|jd�|jd�}|j|ddd|j	�|jd�}|j|ddd|j	�dS(Nt	localhostts/etc/candlepin/candlepin.confit#s&^\s*org.quartz.dataSource.myDS.URL=\S+t=it/it:s+^\s*org.quartz.dataSource.myDS.password=\S+t
PGPASSWORDs/var/log/candlepin/error.logs /var/log/candlepin/candlepin.logt	sizelimits/var/log/candlepin/audit*.log*s%/var/log/candlepin/candlepin.log[.-]*s/var/log/candlepin/cpdb*.log*s/var/log/candlepin/cpinit*.log*s!/var/log/candlepin/error.log[.-]*sdu -sh /var/lib/candlepin/*/*s'            SELECT schema_name, relname,                    pg_size_pretty(table_size) AS size, table_size             FROM (               SELECT                 pg_catalog.pg_namespace.nspname AS schema_name,                 relname,                 pg_relation_size(pg_catalog.pg_class.oid) AS table_size               FROM pg_catalog.pg_class               JOIN pg_catalog.pg_namespace                 ON relnamespace = pg_catalog.pg_namespace.oid             ) t             WHERE schema_name NOT LIKE 'pg_%'             ORDER BY table_size DESC;tsuggest_filenametcandlepin_db_tables_sizestenvsN            SELECT displayname, content_access_mode             FROM cp_owner;tsimple_content_access(
tdbhosttdbpasswdtopentreadt
splitlinesRtsplittIOErrort
IndexErrorRt
add_copy_spectadd_cmd_outputtbuild_query_cmd(tselftcfg_filetlinet_cmd((s9/usr/lib/python2.7/site-packages/sos/plugins/candlepin.pytsetupsH		)!	


	
	cCs2|rdnd}d}||j|t|�fS(sI
        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
        s
-A -F , -XRsUpsql --no-password -h %s -p 5432 -U candlepin                   -d candlepin %s -c %s(RR(Rtquerytcsvt	csvformatt_dbcmd((s9/usr/lib/python2.7/site-packages/sos/plugins/candlepin.pyR]scCs<d}d}|jd||�d}|jd||�dS(Ns$(((.*)(pass|token|secret)(.*))=)(.*)s
\1********s/etc/candlepin/candlepin.confs(--password=)([a-zA-Z0-9]*)s/var/log/candlepin/cpdb.log(tdo_file_sub(Rtregtrepltcpdbreg((s9/usr/lib/python2.7/site-packages/sos/plugins/candlepin.pytpostprocjs
(R(	t__name__t
__module__t__doc__tplugin_nametpackagesR!tFalseRR*(((s9/usr/lib/python2.7/site-packages/sos/plugins/candlepin.pyRs	G
N(tsos.pluginsRRtpipesRtreRR(((s9/usr/lib/python2.7/site-packages/sos/plugins/candlepin.pyt<module>s