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: //usr/lib/python3.6/site-packages/vdo/vdomgmnt/__pycache__/Utils.cpython-36.pyc
3

�nd�
�@s�dZddlmZddlmZddlmZddlmZddlmZmZddl	Z
ddlZddlZddl
Z
ddlZGdd	�d	e�ZdS)
z�
  Utils - miscellaneous utilities for the VDO manager

  $Id: //eng/vdo-releases/aluminum/src/python/vdo/vdomgmnt/Utils.py#2 $

�)�absolute_import)�division)�print_function)�unicode_literals)�CommandError�
runCommandNc@s�eZdZdZdZdeZdeZdeZdeZe	dd��Z
e	dd��Ze	dd��Ze
d	d
��Ze	dd��Ze	d
d��Zdd�ZdS)�Utilsz'Utils contains miscellaneous utilities.icCstjjdd�|jtj�D��S)zTakes a path or a colon-separated list of paths and makes
    each one an absolute path. Paths that don't exist are left alone.cSsg|]}tjj|��qS�)�os�path�abspath)�.0�pr	r	�/usr/lib/python3.6/Utils.py�
<listcomp>5sz%Utils.abspathPath.<locals>.<listcomp>)r
�pathsep�join�split)rr	r	r�abspathPath1szUtils.abspathPathcCstjdtj|7<dS)z�Appends a directory or directories to the current PATH.

    Arguments:
      path (str): A directory or colon-separated list of directories.
    �PATHN)r
�environr)rr	r	r�appendToPath8szUtils.appendToPathcCs|dko||d@dkS)z0Returns True iff its argument is a power of two.r�r	)�ir	r	r�isPowerOfTwoBszUtils.isPowerOfTwocCsfy.tj|tj�xtjd�tj|d�qWWn2tk
r`}z|jtjkrP|�WYdd}~XnXdS)z�Kills a process and waits for it to die.

    Arguments:
      pid:      process id to kill
    Throws:
      Any unexpected OS error
    rrN)	r
�kill�signal�SIGTERM�timeZsleep�OSError�errnoZESRCH)�cls�pid�er	r	r�killProcessHs	
zUtils.killProcesscCs||kr|S|S)z#Returns the maximum of two numbers.r	)�a�br	r	r�maxNum[szUtils.maxNumcCstjj|�S)z�Finds the full path to a command.

    Arguments:
      cmd (str): The command to search for.
    Returns:
      The full path as a string, or None if the command is not found.
    )�	distutilsZspawnZfind_executable)�cmdr	r	r�whichcs	zUtils.whichcCsdS)Nr	)�selfr	r	r�__init__qszUtils.__init__N)�__name__�
__module__�__qualname__�__doc__ZKiBZMiBZGiBZTiBZPiB�staticmethodrrr�classmethodr$r'r*r,r	r	r	rr%s
r)r0Z
__future__rrrrZ	vdo.utilsrrZdistutils.spawnr(r r
rr�objectrr	r	r	r�<module>s