o
    O6ufÉ  ã                   @   sR   d dl mZmZmZmZ G dd„ deƒZG dd„ deeeƒZG dd„ deeƒZdS )	é    )ÚPluginÚRedHatPluginÚDebianPluginÚUbuntuPluginc                   @   s4   e Zd ZdZdZdZdZdd„ Zdd„ Zd	d
„ Z	dS )ÚOpenStackSwiftzOpenStack SwiftÚopenstack_swift)Ú	openstackÚopenstack_controllerz%/var/lib/config-data/puppet-generatedc                 C   sd   |   d¡r|  dg¡ n|  dg¡ |  d| jd | jd | jd | jd g¡ |  d	d
dœ¡ d S )NÚall_logsz/var/log/swift/z/var/log/swift/*.logz/etc/swift/z/swift/etc/*z/swift/etc/swift/*z/swift/etc/xinetd.d/*z"/memcached/etc/sysconfig/memcachedÚ
swift_confÚ	swift_log)z/etc/swift/swift.confz/var/log/swift/swift.log)Ú
get_optionÚadd_copy_specÚvar_puppet_genÚadd_file_tags)Úself© r   úD/usr/lib/python3/dist-packages/sos/report/plugins/openstack_swift.pyÚsetup   s$   
ÿÿûþzOpenStackSwift.setupc                 C   s&   |   d||¡ |   | jd ||¡ dS )z Apply regex substitution z/etc/swift/.*\.conf.*z/swift/etc/swift/.*\.conf.*N)Údo_path_regex_subr   )r   ÚregexpÚsubstr   r   r   Úapply_regex_sub0   s
   þzOpenStackSwift.apply_regex_subc                 C   sL   g d¢}ddg}|   dd |¡› d�d¡ d |¡}|   d|› d�d	¡ d S )
N)Úldap_dns_passwordÚneutron_admin_passwordÚrabbit_passwordÚqpid_passwordÚpowervm_mgr_passwdÚvirtual_power_host_passÚxenapi_connection_passwordÚpasswordÚhost_passwordÚvnc_passwordÚadmin_passwordÚtransport_urlÚ
connectionÚsql_connectionz(^\s*(ú|z)\s*=\s*)(.*)z\1*********z!)\s*=\s*(.*)://(\w*):)(.*)(@(.*))z\1*********\6)r   Újoin)r   Úprotect_keysÚconnection_keysÚjoin_con_keysr   r   r   Úpostproc8   s   þ

þzOpenStackSwift.postprocN)
Ú__name__Ú
__module__Ú__qualname__Ú
short_descÚplugin_nameÚprofilesr   r   r   r,   r   r   r   r   r      s    r   c                   @   ó   e Zd ZdZdS )ÚDebianSwift)	Úswiftzswift-accountzswift-containerzswift-objectzswift-proxyÚswauthzpython-swiftzpython-swauthzpython3-swiftN©r-   r.   r/   Úpackagesr   r   r   r   r4   N   ó    r4   c                   @   r3   )ÚRedHatSwift)zopenstack-selinuxNr7   r   r   r   r   r:   ]   r9   r:   N)Úsos.report.pluginsr   r   r   r   r   r4   r:   r   r   r   r   Ú<module>   s   =