HEX
Server: Apache
System: Linux msm5694.mjhst.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: camjab_ssh (1000)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib/python2.7/site-packages/vdo/vdomgmnt/Utils.pyo
ó
.Åt_c@srdZddlmZmZddlZddlZddlZddlZddl	Z	de
fd„ƒYZdS(s‚
  Utils - miscellaneous utilities for the VDO manager

  $Id: //eng/vdo-releases/magnesium/src/python/vdo/vdomgmnt/Utils.py#1 $

iÿÿÿÿ(tCommandErrort
runCommandNtUtilscBsŸeZdZdZdeZdeZdeZdeZed„ƒZ	ed„ƒZ
ed„ƒZed„ƒZ
ed„ƒZed„ƒZd„ZRS(	s'Utils contains miscellaneous utilities.icCs;tjjg|jtjƒD]}tjj|ƒ^qƒS(sTakes a path or a colon-separated list of paths and makes
    each one an absolute path. Paths that don't exist are left alone.(tostpathseptjointsplittpathtabspath(Rtp((s6/usr/lib/python2.7/site-packages/vdo/vdomgmnt/Utils.pytabspathPath-scCstjdctj|7<dS(s’Appends a directory or directories to the current PATH.

    Arguments:
      path (str): A directory or colon-separated list of directories.
    tPATHN(RtenvironR(R((s6/usr/lib/python2.7/site-packages/vdo/vdomgmnt/Utils.pytappendToPath4scCs|dko||d@dkS(s0Returns True iff its argument is a power of two.ii((ti((s6/usr/lib/python2.7/site-packages/vdo/vdomgmnt/Utils.pytisPowerOfTwo>scCsvyAtj|tjƒx'tr?tjdƒtj|dƒqWWn.tk
rq}|jtj	krr|‚qrnXdS(sŠKills a process and waits for it to die.

    Arguments:
      pid:      process id to kill
    Throws:
      Any unexpected OS error
    iiN(
RtkilltsignaltSIGTERMtTruettimetsleeptOSErrorterrnotESRCH(tclstpidte((s6/usr/lib/python2.7/site-packages/vdo/vdomgmnt/Utils.pytkillProcessDs		
cCs||kr|S|S(s#Returns the maximum of two numbers.((tatb((s6/usr/lib/python2.7/site-packages/vdo/vdomgmnt/Utils.pytmaxNumWscCstjj|ƒS(sµ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.
    (t	distutilstspawntfind_executable(tcmd((s6/usr/lib/python2.7/site-packages/vdo/vdomgmnt/Utils.pytwhich_s	cCsdS(N((tself((s6/usr/lib/python2.7/site-packages/vdo/vdomgmnt/Utils.pyt__init__ms(t__name__t
__module__t__doc__tKiBtMiBtGiBtTiBtPiBtstaticmethodR
R
RtclassmethodRRR$R&(((s6/usr/lib/python2.7/site-packages/vdo/vdomgmnt/Utils.pyR!s




(R)tutilsRRtdistutils.spawnR RRRRtobjectR(((s6/usr/lib/python2.7/site-packages/vdo/vdomgmnt/Utils.pyt<module>s