ó uÈÔec@sUddlmZmZddlZdefd„ƒYZdeefd„ƒYZdS(iÿÿÿÿ(tPlugint RedHatPluginNtOpenShiftOrigincBseZdZdZdZdZdddefdddefdd defgZ d Z d Z e j je d ƒZe j je d ƒZdZe j je eƒZe j je dƒZe j je dƒZeefZd„Zd„Zd„Zd„Zd„Zd„ZRS(s OpenShift Origin torigint openshifttdiags.run 'oc adm diagnostics' to collect its outputtfasts diag-prevents2set --prevent-modification on 'oc adm diagnostics'sall-namespacess$collect dc output for all namespacess/etc/origin/masters/etc/origin/nodesmaster-config.yamls master.envsnode-config.yamlsnode.kubeconfigtpodscCstjj|jƒS(sDetermine if we are on a master(tostpathtexistst master_cfg(tself((s6/usr/lib/python2.7/site-packages/sos/plugins/origin.pyt is_masterFscCstjj|jƒS(sDetermine if we are on a node(RR R tnode_cfg(R ((s6/usr/lib/python2.7/site-packages/sos/plugins/origin.pytis_nodeJscCs"tjjtjj|jdƒƒS(s*Determine if we are on a node running etcds etcd.yaml(RR R tjointstatic_pod_dir(R ((s6/usr/lib/python2.7/site-packages/sos/plugins/origin.pytis_static_etcdNscCstjj|jƒS(s*Determine if a node is running static pods(RR R R(R ((s6/usr/lib/python2.7/site-packages/sos/plugins/origin.pytis_static_pod_compatibleRsc Csutjj|jd|jƒ}tjj|jdƒ}tjj|jddƒ}tjj|jdƒ}tjj|jdƒ}dd|f}d }|jƒrÎ|j|j|j tjj|jd ƒgƒ|j ƒr|jtjj|j d ƒƒ|j d |d |gƒndddg}|j g|D]} d|| f^q7ƒdddg} |j g| D]} d|| f^qpƒ|j dƒrï|jd|ƒ} | djƒd} g| D]}|rÊ|jƒd^qÊ}ndddg}|j g|D]}d||f^q ƒ|j dƒrmd |}|j d!ƒr]|d"7}n|j |ƒn|jd#d$d%d&gƒ|jd'|ƒ}x2|djƒD]}|j d(||fƒqªWn|jƒrQ|j|j|j||||tjj|jd ƒtjj|jd)ƒtjj|jd*ƒg ƒ|jd#d+ƒn|jƒrq|j d,|ƒndS(-Ns bootstrap-sbootstrap.kubeconfigtcertst*s client-ca.crtsadmin.kubeconfigs%s --config=%stocs master-logss*.crts*.yamls %s api apis%s controllers controllerssdescribe projectssadm top imagessadm top imagestreamss%s %st hostsubnettclusternetworkt netnamespacess%s get -o json %ssall-namespacess%s get namespacestoutputiitdefaultsopenshift-web-consoles openshift-ansible-service-brokers%s get -o json dc -n %sRs%s adm diagnostics -l 0s diag-prevents --prevent-modification=truetunitssatomic-openshift-mastersatomic-openshift-master-apis#atomic-openshift-master-controllerss%s get pod -o name -n defaults%s logs -n default %ss resolv.confsnode-dnsmasq.confsatomic-openshift-nodes %s etcd etcd(RR Rt node_base_dirt node_cfg_filetmaster_base_dirR t add_copy_specR t master_envRRtadd_cmd_outputt get_optiontexec_cmdt splitlinestsplitt add_journalRRtnode_kubeconfigR(R tbstrap_node_cfgtbstrap_kubeconfigt node_certstnode_client_cat admin_cfgt oc_cmd_admintstatic_pod_logs_cmdtsubcmdstsubcmdtjcmdstjcmdtocnt ns_outputtntnmspstdiag_cmdRtpod((s6/usr/lib/python2.7/site-packages/sos/plugins/origin.pytsetupVs‚    $ $, $         cCsId}|jd|dƒ|j|jddƒ|j|jddƒdS(Nsq(?P{\s*"name":\s*[^,]*(pass|pwd|key|token|cred|secret|PASS|PWD|KEY|TOKEN|CRED|SECRET)[^,]*,\s*"value":)[^}]*soc*jsons\g "********"s(bindPassword:\s*)(.*)s \1"********"s(clientSecret:\s*)(.*)(tdo_cmd_output_subt do_file_subR (R t env_regexp((s6/usr/lib/python2.7/site-packages/sos/plugins/origin.pytpostprocÉs   N(R(t__name__t __module__t__doc__t plugin_nametNonetfilestprofilestTruetFalset option_listRRRR RR R!RRR(RR RRRR:R>(((s6/usr/lib/python2.7/site-packages/sos/plugins/origin.pyR#s2         stAtomicOpenShiftcBseZdZdZRS(s9 OpenShift Enterprise / OpenShift Container Platform satomic-openshift(satomic-openshift(R?R@RAtpackages(((s6/usr/lib/python2.7/site-packages/sos/plugins/origin.pyRIâs(t sos.pluginsRRtos.pathRRRI(((s6/usr/lib/python2.7/site-packages/sos/plugins/origin.pyt s ¿