Current File : //usr/lib/python2.7/site-packages/sos/plugins/origin.pyo
�
u��ec@sUddlmZmZddlZdefd��YZdeefd��YZdS(i����(tPlugintRedHatPluginNtOpenShiftOrigincBseZdZdZdZdZdddefdddefdd	defgZ	d
Z
dZej
je
d�Zej
je
d
�ZdZej
jee�Zej
jed�Zej
jed�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|jd��|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=%stocsmaster-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 %ssresolv.confsnode-dnsmasq.confsatomic-openshift-nodes%s etcd etcd(RR	Rt
node_base_dirt
node_cfg_filetmaster_base_dirR
t
add_copy_specRt
master_envRRtadd_cmd_outputt
get_optiontexec_cmdt
splitlinestsplittadd_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<var>{\s*"name":\s*[^,]*(pass|pwd|key|token|cred|secret|PASS|PWD|KEY|TOKEN|CRED|SECRET)[^,]*,\s*"value":)[^}]*soc*jsons\g<var> "********"s(bindPassword:\s*)(.*)s\1"********"s(clientSecret:\s*)(.*)(tdo_cmd_output_subtdo_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__tplugin_nametNonetfilestprofilestTruetFalsetoption_listRRRR	RRR!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(tsos.pluginsRRtos.pathRRRI(((s6/usr/lib/python2.7/site-packages/sos/plugins/origin.pyt<module>s�