Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/openstack_neutron.cpython-312.pyc
�

-�_g,��l�ddlZddlmZmZmZmZGd�de�ZGd�deee�ZGd�dee�Zy)	�N)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPluginc�.�eZdZdZdZdZdZd�Zd�Zd�Z	y)	�OpenStackNeutronzOpenStack Networking�openstack_neutron)�	openstack�openstack_controller�openstack_compute�openstack_edpmz-/var/lib/config-data/puppet-generated/neutronc�d�|jd�r|jdg�n|jdg�|jd|jdz|jdz|jdzg�|jd�|jd�|j	dd	�
�|j|j�r
|j}nd}|�d�}g}gd
�}	t
|dd��5}|j�j�D]N}|s�|jd�}|dj�|vs�-|j|dj���P	ddd�|j|�dD�	cgc]}	|	tjv��}
}	dD�	cgc]}	|	tjv��}}	t!|
�rt#|�s|j$j'd�nrgd�}|D]i}
|j)d|
�d��}|ddk(s�!|d}|j�ddD].}|j�d}d|
�d |��}|j+|��0�k|j-d!d"d#��y#1swY��xYw#t$r"}|jd|�d|���Yd}~��;d}~wwxYwcc}	wcc}	w)$N�all_logsz/var/log/neutron/z/var/log/neutron/*.logz
/etc/neutron/z/etc/default/neutron-serverz/etc/my.cnf.d/tripleo.cnfz/var/lib/neutron/z/var/lib/neutron/lockT)�	recursive�z%/etc/neutron/plugins/ml2/ml2_conf.ini)�ovn_nb_private_key�ovn_nb_certificate�ovn_nb_ca_cert�ovn_sb_private_key�ovn_sb_certificate�ovn_sb_ca_cert�rzUTF-8)�encoding�=r�zCould not open conf file z: )�OS_USERNAME�OS_PASSWORD)�OS_TENANT_NAME�OS_PROJECT_NAMEz}Not all environment variables set. Source the environment file for the user intended to connect to the OpenStack environment.)�subnet�port�routerz
network agent�network�	extensionzfloating ipzsecurity groupz
openstack z list�status�output����z show �neutronml2_conf�neutron_server_log)z'.*/etc/neutron/plugins/ml2/ml2_conf.iniz/var/log/neutron/server.log)�
get_option�
add_copy_spec�var_puppet_gen�add_forbidden_path�add_dir_listing�path_exists�open�read�
splitlines�split�strip�append�IOError�
_log_error�os�environ�all�any�soslog�warning�collect_cmd_output�add_cmd_output�
add_file_tags)�self�ml2_pre�
ml2_conf_file�	ml2_certs�
ml2_cert_keys�cfile�line�words�error�p�vars_all�vars_any�cmds�cmd�res�
neutron_items�item�show_cmds                  �F/usr/lib/python3/dist-packages/sos/report/plugins/openstack_neutron.py�setupzOpenStackNeutron.setups����?�?�:�&����#� �
�
���(� �
�	
�������/�1����"?�?����"=�=�	
�	�	
���.�/���� 7�8����4���E����D�/�/�0��)�)�G��G�"�)�#H�I�
��	�
�
�
	)��m�S�7�;�
;�u�!�J�J�L�3�3�5�;�D�� � �J�J�s�O�E��Q�x�~�~�'�=�8�!�(�(��q����)9�:�;�
;�	
���	�*�.2�3��A����O�3��3�.9�:��A����O�:��:��H�
�#�h�-��K�K���!K�
L�	�D��
6���-�-�
�3�%�u�.E�F���x�=�A�%�$'��M�M� -� 8� 8� :�1�R� @�6��#�z�z�|�A���%/��u�F�4�&�#A���+�+�H�5�6�
6�	
���7H�+?�
�	�[
;�
;���	)��O�O�7�
��G � %�w�(�
)�
)��	)��3��:sC�I:�,AI-�8$I-�I:�:J(�J-�-I7�2I:�:	J%�J � J%c�j�|jd||�|j|jdz||�y)z Apply regex substitution z/etc/neutron/*N)�do_path_regex_subr-)rB�regexp�substs   rT�apply_regex_subz OpenStackNeutron.apply_regex_subts7�����/���?�������"2�2��E�	
�c��gd�}dg}dj|�}|jddj|��d�d�|jd|�d�d�y)	N)�rabbit_password�
qpid_password�nova_admin_password�xenapi_connection_password�password�server_auth�admin_password�metadata_proxy_shared_secret�
eapi_password�crd_password�primary_l3_host_password�
serverauth�
ucsm_password�ha_vrrp_auth_password�ssl_key_password�nsx_password�vcenter_password�edge_appliance_password�tenant_admin_password�
apic_password�
transport_url�memcache_secret_key�
connection�|z(^\s*(z
)\s*=\s*)(.*)z\1*********z!)\s*=\s*(.*)://(\w*):)(.*)(@(.*))z
\1*********\6)�joinrZ)rB�protect_keys�connection_keys�
join_con_keyss    rT�postproczOpenStackNeutron.postproc|sg��	
��(�.������1�
�����c�h�h�|�,�-�]�;��	
�	
����m�_�$E�F��	
r[N)
�__name__�
__module__�__qualname__�
short_desc�plugin_name�profilesr-rUrZry�r[rTrrs,��'�J�%�K�7�H�E�N�Y�v
�
r[rc�(��eZdZdZd�Z�fd�Z�xZS)�
DebianNeutron)�neutron-commonzneutron-plugin-ciscoz neutron-plugin-linuxbridge-agentzneutron-plugin-nicirazneutron-plugin-openvswitchz neutron-plugin-openvswitch-agentzneutron-plugin-ryuzneutron-plugin-ryu-agentzneutron-serverzpython-neutronzpython3-neutronc�$�|jd�S)Nr�)�is_installed)rBs rT�
check_enabledzDebianNeutron.check_enabled�s��� � �!1�2�2r[c�D��t�|��|jd�y)Nz/etc/sudoers.d/neutron_sudoers)�superrUr,�rB�	__class__s �rTrUzDebianNeutron.setup�s���
��
�����;�<r[)rzr{r|�packagesr�rU�
__classcell__�r�s@rTr�r��s����H�3�=�=r[r�c�&��eZdZdZdZ�fd�Z�xZS)�
RedHatNeutron)zopenstack-selinuxz'/var/lib/config-data/ansible-generated/c���t�|��|jd|jdz|jdz|jdzg�y)Nz/etc/sudoers.d/neutron-rootwrapz/neutron-dhcp-agent/z/neutron-dhcp-ovn/z/neutron-sriov-agent/)r�rUr,�var_ansible_genr�s �rTrUzRedHatNeutron.setup�sO���
��
�����-�� � �#9�9�� � �#7�7�� � �#:�:�	
�	r[)rzr{r|r�r�rUr�r�s@rTr�r��s���%�H�?�O��r[r�)	r9�sos.report.pluginsrrrrrr�r�r�r[rT�<module>r�s?��
�O�O�B
�v�B
�J=�$�l�L�=�.�$�l�r[