Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/module_utils/facts/hardware/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/module_utils/facts/hardware/netbsd.pyc

�
�Udac@`s�ddlmZmZmZeZddlZddlZddlm	Z	ddl
mZmZddl
mZmZddlmZmZmZddlmZdefd	��YZd
efd��YZdS(i(tabsolute_importtdivisiontprint_functionN(treduce(tHardwaretHardwareCollector(tTimeoutErrorttimeout(tget_file_contenttget_file_linestget_mount_size(t
get_sysctltNetBSDHardwarecB`s_eZdZdZddddgZdd�Zd�Zd�Ze	�d	��Z
d
�ZRS(s�
    NetBSD-specific subclass of Hardware.  Defines memory and CPU facts:
    - memfree_mb
    - memtotal_mb
    - swapfree_mb
    - swaptotal_mb
    - processor (a list)
    - processor_cores
    - processor_count
    - devices
    tNetBSDtMemTotalt	SwapTotaltMemFreetSwapFreecC`s�i}t|jdg�|_|j�}|j�}i}y|j�}Wntk
r_nX|j�}|j|�|j|�|j|�|j|�|S(Ntmachdep(	Rtmoduletsysctlt
get_cpu_factstget_memory_factstget_mount_factsRt
get_dmi_factstupdate(tselftcollected_factsthardware_factst	cpu_factstmemory_factstmount_factst	dmi_facts((sN/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/netbsd.pytpopulate.s




cC`s�i}d}d}i}tjdtj�s1|Sg|d<x�td�D]�}|jdd�}|dj�}|dks�|dkr�d|kr�g|d<n|dj|dj��|d7}qH|dkr|dj�}||kr*d||<q*qH|d	krHt|dj��||<qHqHWt|�dkrot|�|d
<t	d�|j
��|d<n||d
<d
|d<|S(Nis
/proc/cpuinfot	processort:is
model namet	Processorsphysical ids	cpu corestprocessor_countcS`s||S(N((txty((sN/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/netbsd.pyt<lambda>^stprocessor_corestNA(tostaccesstR_OKR	tsplittstriptappendtinttlenRtvalues(RRtitphysidtsocketstlinetdatatkey((sN/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/netbsd.pyRCs6


!

cC`s�i}tjdtj�s|Sx}td�D]o}|jdd�}|d}|tjkr,|dj�jd�d}t|�d|d|j	�<q,q,W|S(Ns
/proc/meminfoR#iit is%s_mb(
R+R,R-R	R.RtMEMORY_FACTSR/R1tlower(RRR7R8R9tval((sN/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/netbsd.pyRes
%cC`s�i}g|d<td�}|s&|Sx�|j�D]�}|jd�s3|j�dkr`q3ntjdd|�j�}t|d�}i|dd6|d	d
6|dd6|d
d6}|j|�|dj	|�q3W|S(Ntmountss
/etc/fstabt#ts\s+R:itmountitdeviceitfstypeitoptions(
Rt
splitlinest
startswithR/tretsubR.R
RR0(RRtfstabR7tfieldstmount_statvfs_infot
mount_info((sN/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/netbsd.pyRrs"
!
cC`ski}idd6dd6dd6dd6d	d
6}x5|D]-}||jkr6|j||||<q6q6W|S(Ntproduct_namesmachdep.dmi.system-producttproduct_versionsmachdep.dmi.system-versiontproduct_uuidsmachdep.dmi.system-uuidtproduct_serialsmachdep.dmi.system-serialt
system_vendorsmachdep.dmi.system-vendor(R(RR t
sysctl_to_dmitmib((sN/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/netbsd.pyR�s

N(t__name__t
__module__t__doc__tplatformR;tNoneR!RRRRR(((sN/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/netbsd.pyRs	"	
tNetBSDHardwareCollectorcB`seZeZdZRS(R
(RTRURt_fact_classt	_platform(((sN/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/netbsd.pyRY�s(t
__future__RRRttypet
__metaclass__R+RGtansible.module_utils.six.movesRt(ansible.module_utils.facts.hardware.baseRRt"ansible.module_utils.facts.timeoutRRt ansible.module_utils.facts.utilsRR	R
t!ansible.module_utils.facts.sysctlRRRY(((sN/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/netbsd.pyt<module>s�

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]