HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //lib/python3.6/site-packages/vdo/vdomgmnt/__pycache__/KernelModuleService.cpython-36.pyc
3

�ndY�@s|dZddlmZddlmZddlmZddlmZddlmZmZddl	m
Z
mZmZdd	l
Z
dd	lZGd
d�de�Zd	S)z�
  KernelModuleService - manages the kvdo kernel module

  $Id: //eng/vdo-releases/aluminum/src/python/vdo/vdomgmnt/KernelModuleService.py#3 $

�)�absolute_import)�division)�print_function)�unicode_literals�)�Defaults�Service)�Command�CommandError�
runCommandNcsZeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	�fdd�Z
dd�Z�ZS)�KernelModuleServicez>KernelModuleService manages a kernel module on the local node.Tc
Csh|rdnd}yBtddddd|jdgd|d	�td
ddddtjgd|d	�dStk
rbdSXd
S)z@Returns True if the module is loaded and DM target is available.�rZlsmod�|Zgrepz-q�'T)�shell�retries�dmsetup�targetsFN)r�_namer�
vdoTargetNamer
)�self�waitr�r�)/usr/lib/python3.6/KernelModuleService.py�running)s
zKernelModuleService.runningcCstd|jg�dS)zLoads the module if necessary.�modprobeN)rr)rrrr�start6szKernelModuleService.startcCs.td�|jtd�|jd�td�tj|j��iS)zAReturns a dictionary representing the status of this object.
    �NameZLoadedFzVersion information)�_rr�yamlZ	safe_load�version)rrrr�status;s
zKernelModuleService.statuscCstdd|jg�dS)zRemoves the module.rz-rN)rr)rrrr�stopCszKernelModuleService.stopcCsD|jd}x4td|jgdd�j�D]}|jd�dkr"||7}q"W|S)z'Returns the module version as a string.� ZmodinfoT)�noThrowr r)rr�
splitlines�find)r�s�linerrrr Hs

zKernelModuleService.versioncCs`xZtddgdd�j�D]B}tjtj�d}tj||�}|dk	rttt	|j
d�jd���SqWd
S)z/Returns the dmsetup targets version as a numberrrT)r$z\s+v(\d+\.\d+\.\d+)Nr�.r)rrr)rr%�re�escaperr�match�tuple�map�int�group�split)rr(ZversionMatchr rrr�
targetVersionQsz!KernelModuleService.targetVersioncstt|�j|�dS)N)�superr�__init__)r�name)�	__class__rrr4^szKernelModuleService.__init__cCsdS)zgKernelModuleService does not exclude any of its __dict__ contents
       from its __repr__ result.
    Tr)r�keyrrr�_reprAttributedsz"KernelModuleService._reprAttribute)T)
�__name__�
__module__�__qualname__�__doc__rrr!r"r r2r4r8�
__classcell__rr)r6rr$s

	
r)r<Z
__future__rrrr�rrZ	vdo.utilsr	r
rr*rrrrrr�<module>s