| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python2.7/dist-packages/landscape/lib/ |
Upload File : |
}9Rc @ s d d l m Z d d l Z d d l Z d d l Z e d d d d d d d d
d d d
d d d d g Z e j d Z e d Z d Z
d Z d Z d S( i( t divisionNt extt ext2t ext3t ext4t reiserfst ntfst msdost dost vfatt xfst hpfst jfst ufst hfst hfspluss ([a-z]+)[0-9]*c c s xt | D] } y, | j d \ } } } | j d } Wn t k
rU q
n X| d k rt | | k rt q
n d
} y | | } Wn t k
r q
n X| t j } | t j | | }
| t j | | } i | d 6| d 6| d 6|
d 6| d 6Vq
Wd S( sZ
This is a generator that yields information about mounted filesystems.
@param mounts_file: A file with information about mounted filesystems,
such as C{/proc/mounts}.
@param statvfs_: A function to get file status information.
@param filesystems_whitelist: Optionally, a list of which filesystems to
stat.
@return: A C{dict} with C{device}, C{mount-point}, C{filesystem},
C{total-space} and C{free-space} keys. If the filesystem information
is not available, C{None} is returned. Both C{total-space} and
C{free-space} are in megabytes.
i s
string-escapei t devices mount-pointt
filesystems total-spaces
free-spaceNi (
t opent splitt decodet
ValueErrort Nonet OSErrort statvfst F_BSIZEt F_BLOCKSt F_BFREE( t mounts_filet statvfs_t filesystems_whitelistt lineR t mount_pointR t megabytest statst
block_sizet total_spacet
free_space( ( s6 /usr/lib/python2.7/dist-packages/landscape/lib/disk.pyt get_mount_info s(
c C s d } t j j | } | j d } xf t | | D]U } | d j d } | j | d r7 | s | t | | k r | } q q7 q7 W| S( s
Tries to determine to which of the mounted filesystem C{path} belongs to,
and then returns information about that filesystem or C{None} if it
couldn't be determined.
@param path: The path we want filesystem information about.
@param mounts_file: A file with information about mounted filesystems,
such as C{/proc/mounts}.
@param statvfs_: A function to get file status information.
@param filesystems_whitelist: Optionally, a list of which filesystems to
stat.
@return: A C{dict} with C{device}, C{mount-point}, C{filesystem},
C{total-space} and C{free-space} keys. If the filesystem information
is not available, C{None} is returned. Both C{total-space} and
C{free-space} are in megabytes.
t /s mount-pointN( R t ost patht realpathR R&