Current File : //usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyc
�
u��ec@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		Cs|jr�d|j|j|f}|j|dt�}|ddkr_|jd|j�dSytj|d�}Wq"tk
r�|jd|�dSXn�yUt|d��@}ytj	|�}Wn#tk
r�|jd|�dSXWdQXWn+t
k
r!}|jd	||f�dSXy4gtj|d
�D]}||kr9|^q9SWn"t
k
rz|jd|�nXdS(Ns%s exec %s cat %st
foregroundtstatusis3Could 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_runtimetexec_cmdtTruet
_log_errortjsontloadst	ExceptiontopentloadtIOErrortsixtiterkeystAttributeError(	tselftfilenametskiptcmdtrestdbtftexttable((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pytget_tables_from_schemas<		

	+
cCs6|s
dSx%|D]}|jd||f�qWdS(Ns
%s list %s(tappend(RRtcmdstovn_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 psR	iR
sovn-dbs-bundlei����(Rt
splitlinestsplitR
RRtFalse(Rtruntimetcontainer_statustline((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pytrunning_in_container@s	cCs|j�ptt|�j�S(N(R1tsuperRt
check_enabled(R((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyR3KscCs5|j�}tjjd�}xdddgD]n}|jtjjd|�tjjd|�tjjd|�g�|r.|jtjj||��q.q.Wdd	d
ddd
dg}d}|jtjj|d��}|jtjj|d�dg�}|j||d�|j||d�|r^g|D]}d|j	|j
|f^q6}n|j|dt�|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/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 %sRs/etc/sysconfig/ovn-northdt	OVS_DBDIRsovnnb_db.dbsovnsb_db.dbs/usr/local/etc/openvswitchs/etc/openvswitchs/var/lib/openvswitchtunitss
ovn-northd(R1tostenvirontgett
add_copy_spectpathtjoinR$R(RR
tadd_cmd_outputRtadd_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.pytsetupOsL#	,
#(RRN(
t__name__t
__module__t__doc__tplugin_nametprofilestNoneRR
R$R(R1R3RH(((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyRs!			tRedHatOVNCentralcBseZdZRS(sopenvswitch-ovn-centralsovn2.*-central(sopenvswitch-ovn-centralsovn2.*-central(RIRJtpackages(((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyRO�stDebianOVNCentralcBseZdZRS(sovn-central(sovn-central(RIRJRP(((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyRQ�s(tsos.pluginsRRRRRR8RRRORQ(((s;/usr/lib/python2.7/site-packages/sos/plugins/ovn_central.pyt<module>s"z