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/openbsd.pyc

�
�Udac@`s�ddlmZmZmZeZddlZddlmZddl	m
Z
mZddlm
Z
ddlmZmZddlmZde
fd	��YZd
efd��YZdS(i(tabsolute_importtdivisiontprint_functionN(tto_text(tHardwaretHardwareCollector(ttimeout(tget_file_contenttget_mount_size(t
get_sysctltOpenBSDHardwarecB`sYeZdZdZdd�Zej�d��Zd�Zd�Z	d�Z
d�ZRS(	sA
    OpenBSD-specific subclass of Hardware. Defines memory, CPU and device facts:
    - memfree_mb
    - memtotal_mb
    - swapfree_mb
    - swaptotal_mb
    - processor (a list)
    - processor_cores
    - processor_count
    - processor_speed

    In addition, it also defines number of DMI facts and device facts.
    tOpenBSDcC`s�i}t|jdg�|_|j�}|j�}|j�}|j�}i}y|j�}Wntj	k
rznX|j
|�|j
|�|j
|�|j
|�|j
|�|S(Nthw(R	tmoduletsysctltget_processor_factstget_memory_factstget_device_factst
get_dmi_factstget_mount_factsRtTimeoutErrortupdate(tselftcollected_factsthardware_factst	cpu_factstmemory_factstdevice_factst	dmi_factstmount_facts((sO/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/openbsd.pytpopulate.s"




cC`si}g|d<td�}|rx�|j�D]�}|jd�s/|j�dkr\q/ntjdd|�j�}|ddks/|d	d
kr�q/nt|d�}i|dd6|dd
6|dd6|d	d6}|j|�|dj	|�q/Wn|S(Ntmountss
/etc/fstabt#ts\s+t itnoneitxxtmountitdeviceitfstypetoptions(
Rt
splitlinest
startswithtstriptretsubtsplitRRtappend(RRtfstabtlinetfieldstmount_statvfs_infot
mount_info((sO/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/openbsd.pyRFs$
! 
cC`s,i}|jjd�\}}}|dkrwt|j�dj�d�d|d<t|jd�dd|d<n|jjd	�\}}}|dkr(idtd
�6dtd�6dtd�6}t|d
d�j�}t|dj	|��d|d<t|dj	|��d|d<n|S(Ns/usr/bin/vmstatii����iit
memfree_mbs
hw.usermemtmemtotal_mbs/sbin/swapctl -skukumugterrorstsurrogate_or_stricti����tswapfree_mbitswaptotal_mb(
R
trun_commandtintR)R.RtNonetordRt	translate(RRtrctoutterrt	swaptranstdata((sO/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/openbsd.pyR\s("
!$cC`sti}g}x5tt|jd��D]}|j|jd�q&W||d<|jd|d<|jd|d<|S(Nshw.ncpushw.modelt	processortprocessor_counttprocessor_cores(trangeR<RR/(RRREti((sO/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/openbsd.pyRvs 
cC`s7i}g}|j|jdjd��||d<|S(Nshw.disknamest,tdevices(textendRR.(RRRK((sO/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/openbsd.pyR�s

cC`ski}idd6dd6dd6dd6d	d
6}x5|D]-}||jkr6|j||||<q6q6W|S(Ntproduct_names
hw.producttproduct_versions
hw.versiontproduct_uuidshw.uuidtproduct_serialshw.serialnot
system_vendors	hw.vendor(R(RRt
sysctl_to_dmitmib((sO/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/openbsd.pyR�s

N(t__name__t
__module__t__doc__tplatformR=RRRRRRR(((sO/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/openbsd.pyR
s
			tOpenBSDHardwareCollectorcB`seZeZdZRS(R(RTRUR
t_fact_classt	_platform(((sO/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/openbsd.pyRX�s(t
__future__RRRttypet
__metaclass__R,tansible.module_utils._textRt(ansible.module_utils.facts.hardware.baseRRtansible.module_utils.factsRt ansible.module_utils.facts.utilsRRt!ansible.module_utils.facts.sysctlR	R
RX(((sO/usr/lib/python2.7/site-packages/ansible/module_utils/facts/hardware/openbsd.pyt<module>s�

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