Current File : //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/oratab.cpython-36.pyc
3

\��h��@s2ddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�RedHatPlugin�	PluginOptc@s6eZdZdZdZd
ZdZeddedd�gZ	dd�Z
d	S)�Oratabz.Oratab discovery for Oracle instances on Linux�oratab�servicesz/etc/oratabzlocation of the oratab file)�defaultZval_typeZdesccs��jd�}tjj|�r�y�t��t|ddd��F}x>|j�j�D].}|jd�s<|j	�rVq<�j
|jd�d�q<WWdQRXdd	g}�j��fd
d�|D��Wq�t
k
r�}z�jd|�d
|���dSd}~Xq�Xn
�jd�dS)Nr�rzUTF-8)�encoding�#�:�z
dbs/init*.orazdbs/spfile*.oracs"g|]}�D]}�j||��qqS�)Z	path_join)�.0Zdbfile�path)�	path_list�selfr�/usr/lib/python3.6/oratab.py�
<listcomp>/sz Oratab.setup.<locals>.<listcomp>zCould not open conf file z: z@Could not locate oratab file. Oracle data will not be collected.)Z
get_option�osr�isfile�set�open�read�
splitlines�
startswith�strip�add�splitZ
add_copy_spec�IOErrorZ
_log_errorZ	_log_warn)rZora_tabZofile�lineZdbfilesZexr)rrr�setups"
"zOratab.setupN)r)r)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesr�strZoption_listr!rrrrr
s
r)rZsos.report.pluginsrrrrrrrr�<module>	s