????

Your IP : 216.73.216.152


Current Path : /usr/lib/python2.7/site-packages/sos/plugins/
Upload File :
Current File : //usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyo

�
Dr^c@s�ddlmZmZmZmZddlZddlZddlZdefd��YZdeefd��YZ	deeefd��YZ
dS(	i����(tPlugintRedHatPlugintDebianPlugintUbuntuPluginNt
OVNCentralcBsVeZdZdZd	Zd
Zd
Zgd�Zd�Z	d�Z
d�Zd�ZRS(s OVN Northd
    tovn_centraltnetworktvirtc		Csy|jr�d|j|j|f}|j|�}|ddkrY|jd|j�dSytj|d�}Wqtk
r�|jd|�dSXn�yUt|d��@}ytj|�}Wn#tk
r�|jd|�dSXWdQXWn+t	k
r}|jd||f�dSXy4gt
j|d	�D]}||kr3|^q3SWn"tk
rt|jd
|�nXdS(Ns%s exec %s cat %ststatusis3Could not retrieve DB schema file from container %stoutputsCannot parse JSON file %strs$Could not open DB schema file %s: %sttabless DB schema %s has no 'tables' key(
t_container_namet_container_runtimetget_command_outputt
_log_errortjsontloadst	ExceptiontopentloadtIOErrortsixtiterkeystAttributeError(	tselftfilenametskiptcmdtrestdbtftexttable((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pytget_tables_from_schemas<		

	+
cCs,x%|D]}|jd||f�qWdS(Ns
%s list %s(tappend(RRtcmdstovn_cmdR!((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pytadd_database_output:s
cCs�x�ddgD]s}|j|d�}|ddkr
xG|dj�D]2}d|krG|j�d|_||_tSqGWq
q
WtS(	Ntpodmantdockers psRiR	sovn-dbs-bundlei����(Rt
splitlinestsplitRR
tTruetFalse(Rtruntimetcontainer_statustline((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pytrunning_in_container>s	cCs|j�ptt|�j�S(N(R0tsuperRt
check_enabled(R((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyR2IscCsA|j�}tjjd�}x�dddgD]�}|jtjjd|�tjjd|�tjjd|�tjjd|�g�|r.|jtjj||��q.q.Wd	d
ddd
ddg}d}|jtjj|d��}|jtjj|d�dg�}|j||d�|j||d�|rpg|D]}d|j	|j
|f^qH}n|j|�|jd�tjjd�}	x�ddgD]�}
|jtjjd|
�tjjd|
�tjjd|
�tjjd|
�g�|	r�|jtjj|	|
��q�q�W|jdd�dS( Nt
OVS_RUNDIRsovnnb_db.pidsovnsb_db.pidsovn-northd.pids/var/lib/openvswitch/ovns/usr/local/var/run/openvswitchs/var/run/openvswitch/s/run/openvswitch/sovn-nbctl showsovn-sbctl showsovn-sbctl lflow-listsovn-nbctl get-sslsovn-nbctl get-connectionsovn-sbctl get-sslsovn-sbctl get-connections/usr/share/openvswitchsovn-nb.ovsschemasovn-sb.ovsschematLogical_Flows	ovn-nbctls	ovn-sbctls
%s exec %s %ss/etc/sysconfig/ovn-northdt	OVS_DBDIRsovnnb_db.dbsovnsb_db.dbs/usr/local/etc/openvswitchs/etc/openvswitchs/var/lib/openvswitchtunitss
ovn-northd(
R0tostenvirontgett
add_copy_spectpathtjoinR"R&R
Rtadd_cmd_outputtadd_journal(Rt
containerizedt
ovs_rundirtpidfileR$t
schema_dirt	nb_tablest	sb_tablesRt	ovs_dbdirtdbfile((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pytsetupMsN#	,

#(RRN(
t__name__t
__module__t__doc__tplugin_nametprofilestNoneR
RR"R&R0R2RG(((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyRs!			tRedHatOVNCentralcBseZdZRS(sopenvswitch-ovn-central(sopenvswitch-ovn-central(RHRItpackages(((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyRN�stDebianOVNCentralcBseZdZRS(sovn-central(sovn-central(RHRIRO(((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyRP�s(tsos.pluginsRRRRRR7RRRNRP(((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyt<module>s"y