ó 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ƒ|j dƒ|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(t do_file_sub(Rtregtrepltcpdbreg((s9/usr/lib/python2.7/site-packages/sos/plugins/candlepin.pytpostprocjs (R( t__name__t __module__t__doc__t plugin_nametpackagesR!tFalseRR*(((s9/usr/lib/python2.7/site-packages/sos/plugins/candlepin.pyRs  G N(t sos.pluginsRRtpipesRtreRR(((s9/usr/lib/python2.7/site-packages/sos/plugins/candlepin.pyt s