%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/ansible/module_utils/facts/system/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/ansible/module_utils/facts/system/__pycache__/local.cpython-39.pyc

a

�)g��@s�ddlmZmZmZeZddlZddlZddlZddl	Z	ddl
mmm
ZddlmZddlmZddlmZddlmZmZGdd�de�ZdS)	�)�absolute_import�division�print_functionN)�to_text)�get_file_content)�BaseFactCollector)�configparser�StringIOc@s eZdZdZe�Zddd�ZdS)�LocalFactCollector�localNcCs�i}i|d<|s|S|j�dd�}|r2tj�|�s6|Si}tt�|d��D�]f}tj�|��dd�}d}zt	j
t�	|�t	j@}	WnRty�}
z:d|t
|
�f}|||<|�|�WYd}
~
qLWYd}
~
n
d}
~
00|	�rfz,|�|�\}}}
|dk�rd|||
f}Wn:ttf�yD}
zd	|t
|
�f}WYd}
~
n
d}
~
00|du�rr|||<|�|�qLnt|dd
�}zt
|dd�}Wn2t�y�d
|}|||<|�|�YqLYn0zt�|�}Wn�t�ylt��}z|�t|��Wn(tj�yd|}|�|�YnR0i}|��D]B}||v�r:i||<|�|�D]}|�||�}||||<�qD�q$Yn@t�y�}
z&d|t
|
�f}|�|�WYd}
~
n
d}
~
00|||<qL||d<|S)Nr�	fact_pathz/*.factz.fact�zCould not stat fact (%s): %srz3Failure executing fact script (%s), rc: %s, err: %sz&Could not execute fact script (%s): %s)�defaultZsurrogate_or_strict)�errorsz9error loading fact - output of running "%s" was not utf-8z=error loading facts as JSON or ini - please check content: %sz"Failed to convert (%s) to JSON: %s)�params�get�os�path�exists�sorted�glob�basename�replace�stat�S_IXUSR�ST_MODE�OSErrorr�warnZrun_command�IOErrorr�UnicodeError�json�loads�
ValueErrorrZConfigParserZreadfpr	�ErrorZsections�options�	Exception)�self�moduleZcollected_factsZlocal_factsrr�fnZ	fact_baseZfailedZexecutable_fact�e�rc�out�errZfactZcpZsect�opt�val�r/�K/usr/lib/python3.9/site-packages/ansible/module_utils/facts/system/local.py�collect$sv
"
&




 
zLocalFactCollector.collect)NN)�__name__�
__module__�__qualname__�name�setZ	_fact_idsr1r/r/r/r0r
 sr
)Z
__future__rrr�typeZ
__metaclass__rr rrZ"ansible.module_utils.compat.typingZmodule_utils�compat�typing�tZansible.module_utils._textrZ ansible.module_utils.facts.utilsrZ$ansible.module_utils.facts.collectorrZansible.module_utils.six.movesrr	r
r/r/r/r0�<module>s

Zerion Mini Shell 1.0