Ë
    Û1jè  ã                   ó8   — d dl Z d dlmZmZmZ  G d„ dee«      Zy)é    N)ÚPluginÚDebianPluginÚ	PluginOptc                   ó@   — e Zd ZdZdZdZdZ eddd¬«      gZd	„ Z	d
„ Z
y)ÚProxmoxzÐ
    This plugin will capture information about the system's
    Proxmox Virtualization Environment.

    It will collect information about the cluster, nodes, pools and
    storage from the Proxmox API.
    zProxmox cluster informationÚproxmox)z
proxmox-veúoutput-formatsz@List of output formats to use for the commands separated by ":".Útext)ÚdescÚdefaultc                 ó  — | j                  d«      j                  d«      }g d¢}g }|D ]"  }|j                  | j                  |«      «       Œ$ | j	                  |D ��cg c]  }|D ]  }d|› d|dk(  rdnd› d	|› �‘Œ Œ c}}«       y c c}}w )
Nr	   ú:)zcluster/resourceszcluster/config/nodeszcluster/optionsznodes/:id/statusznodes/:id/storageznodes/:id/networkÚpoolsÚstoragezstorage/:sidzcluster/ceph/statuszcluster/ceph/metadatazcluster/ceph/flagsz
pvesh get ú r
   z
--noborderÚ z --output-format )Ú
get_optionÚsplitÚextendÚbuild_cmd_pathsÚadd_cmd_output)ÚselfÚoutput_formatsÚcommandsÚ	cmd_pathsÚcommandÚcmdÚformats          ú</usr/lib/python3/dist-packages/sos/report/plugins/proxmox.pyÚsetupzProxmox.setup$   s¼   € ØŸ™Ð)9Ó:×@Ñ@ÀÓEˆò
ˆð ˆ	àò 	<ˆGØ×Ñ˜T×1Ñ1°'Ó:Õ;ð	<ð 	×Ñð !÷
ð Ø(ò	
ð ð ˜˜˜Q¨v¸Ò/?™|ÀRÐHð IØ%˜hò(ð
ð(ó
õ 	ùó 
s   Á B
c           
      óÐ  — |j                  d«      }g }t        d„ t        |«      D «       d«      }|�”dj                  |d| «      }dj                  ||dz   d «      }| j	                  d|› d�«      }|d   dk(  rJt        j                  |d	   «      }|D ]-  }	|j                  | j                  |› d|	d
   › d|› �«      «       Œ/ |S |j                  dj                  |«      «       |S )zØ
        Build command paths,
        replacing dynamic attributes with data from the API

        :param base_path: The base path to build from
        :type base_path: str

        :return: A list of paths
        ú/c              3   óH   K  — | ]  \  }}|j                  d «      r|–— Œ y­w)r   N)Ú
startswith)Ú.0ÚiÚparts      r   ú	<genexpr>z*Proxmox.build_cmd_paths.<locals>.<genexpr>O   s'   è ø€ ò 2™w˜q $Ø ŸO™O¨CÔ0ô ñ 2ùs   ‚ "Né   z	pvesh ls z --output-format jsonÚstatusr   ÚoutputÚname)
r   ÚnextÚ	enumerateÚjoinÚexec_cmdÚjsonÚloadsr   r   Úappend)
r   Ú	base_pathÚpartsÚpathsÚid_indexÚpathÚtrailing_pathÚresultsÚchildrenÚchilds
             r   r   zProxmox.build_cmd_pathsB   s  € ð —‘ Ó$ˆØˆäñ 2¬)°EÓ*:ô 2Ø37ó9ˆð ÐØ—8‘8˜E ) 8Ð,Ó-ˆDØŸH™H U¨8°a©<¨=Ð%9Ó:ˆMà—m‘m i°¨vÐ5JÐ$KÓLˆGà�xÑ  AÒ%ÜŸ:™: g¨hÑ&7Ó8�Ø%ò �EØ—L‘LØ×,Ñ,Ø#˜f A e¨F¡m _°A°m°_ÐEóõðð ˆð �L‰L˜Ÿ™ %›Ô)Øˆó    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
short_descÚplugin_nameÚpackagesr   Úoption_listr    r   © r=   r   r   r      s>   „ ñð /€Jà€KØ€Hñ 	Ð"ð<à ô	ð€Kòó<!r=   r   )r1   Úsos.report.pluginsr   r   r   r   rF   r=   r   ú<module>rH      s    ðó ç >Ñ >ôTˆf�lõ Tr=   