Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/lvm2.cpython-312.pyc |
�
-�_ge � �4 � d dl mZmZmZmZ G d� dee� Zy)� )�Plugin�IndependentPlugin�SoSPredicate� PluginOptc �l � e Zd ZdZdZdZ eddd�� eddd �� ed
dd�� gZdd�Zd
� Z d� Z
y)�Lvm2zLogical Volume Manager 2�lvm2)�storage�lvmdumpFzcollect an lvmdump tarball)�default�desc�
lvmdump-amzAattempt to collect lvmdump with advanced options and raw metadata�metadataz0attempt to collect headers and metadata via pvckc � � | j dd�� }d}d}|rd}|||fz }| j || j � �� y) z|Collects an lvmdump in standard format with optional metadata
archives for each physical volume present.
r F)�name�makezlvmdump %s -d '%s'� z-a -m)�chrootN)�get_cmd_output_path�add_cmd_output�tmp_in_sysroot)�selfr �lvmdump_path�lvmdump_cmd�lvmdump_opts�cmds �9/usr/lib/python3/dist-packages/sos/report/plugins/lvm2.py�
do_lvmdumpzLvm2.do_lvmdump sV � � �/�/�Y�U�/�K��*�����"�L��\�<�8�8�����C��(;�(;�(=��>� c � � | j d� }|d dk( r@|d j � D ]) }d|� �d|� �d|� d�d |� d�g}| j |d
�� �+ yy)
zj Collects the output of the command pvck for each block device
present in the system.
zpvs -o pv_name --no-headings�statusr �outputzpvck --dump headers zpvck --dump metadata zpvck --dump metadata_all z -vzpvck --dump metadata_search r )�subdirN)�exec_cmd�
splitlinesr )r �
block_list�line�cmdss r �get_pvck_outputzLvm2.get_pvck_output, s� � �
�]�]�*�
�
� �h��1�$�"�8�,�7�7�9�
=��*�4�&�1�+�D�6�2�/��v�S�9�2�4�&��<� �� �#�#�D��#�<�
=� %r c � � ddd�}t t | |�� � rd}nd}|dz }| j d|� �d d �
� d}|dz d
z }d}|dz dz }d}| j d|� d|� �d�� | j d|� d|� �d�� | j d|� d|� �d�� | j d|� �d|� �g� | j d� | j d� | j d� r| j � n#| j d� r| j d� � | j d!� r| j
� y y )"Nzvgdisplay -hz--nolocking)r r"