AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.148.102.84
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python2.7/site-packages/ansible/plugins/connection/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /lib/python2.7/site-packages/ansible/plugins/connection/lxd.pyc
�
��\c@`s�ddlmZmZmZeZdZddlZddlm	Z	ddl
mZmZm
Z
ddlmZmZmZddlmZmZddlmZd	efd
��YZdS(i(tabsolute_importtdivisiontprint_functions�
    author: Matt Clay <matt@mystile.com>
    connection: lxd
    short_description: Run tasks in lxc containers via lxc CLI
    description:
        - Run commands or put/fetch files to an existing lxc container using lxc CLI
    version_added: "2.0"
    options:
      remote_addr:
        description:
            - Container identifier
        default: inventory_hostname
        vars:
            - name: ansible_host
            - name: ansible_lxd_host
      executable:
        description:
            - shell to use for execution inside container
        default: /bin/sh
        vars:
            - name: ansible_executable
            - name: ansible_lxd_executable
N(tfind_executable(tcalltPopentPIPE(tAnsibleErrortAnsibleConnectionFailuretAnsibleFileNotFound(tto_bytestto_text(tConnectionBaset
ConnectioncB`s\eZdZdZeZdZd�Zd�Zd	ed�Z
d�Zd�Zd�Z
RS(
s lxd based connections tlxdtrootcO`s�tt|�j||||�|jj|_td�|_|jsUtd��n|jj	dk	r�|jj	dkr�|jjd�ndS(Ntlxcslxc command not found in PATHRs?lxd does not support remote_user, using container default: root(
tsuperR
t__init__t
_play_contexttremote_addrt_hostRt_lxc_cmdRtremote_usertNonet_displaytwarning(tselftplay_contextt	new_stdintargstkwargs((sB/usr/lib/python2.7/site-packages/ansible/plugins/connection/lxd.pyR0s	$cC`sEtt|�j�|jsA|jjdd|j�t|_ndS(s$connect to lxd (nothing to do here) u'ESTABLISH LXD CONNECTION FOR USER: rootthostN(RR
t_connectt
_connectedRtvvvRtTrue(R((sB/usr/lib/python2.7/site-packages/ansible/plugins/connection/lxd.pyR!<s	c	C`sGtt|�j|d|d|�|jjdj|�d|j�|jd|jd|jj	d|g}g|D]}t
|dd	�^qr}t
|dd	d
d�}t|dtd
tdt�}|j
|�\}}t|�}t|�}|dkrtd|j��n|dkr7td|j��n|j||fS(s# execute a command on the lxd host tin_datatsudoableuEXEC {0}R texecs--s-cterrorstsurrogate_or_strictt	nonstringtpassthrutstdintstdouttstderrs!error: Container is not running.
scontainer not running: %sserror: not found
scontainer not found: %s(RR
texec_commandRR#tformatRRRt
executableR
RRtcommunicateRRt
returncode(	RtcmdR%R&t	local_cmdtitprocessR-R.((sB/usr/lib/python2.7/site-packages/ansible/plugins/connection/lxd.pyR/Ds""'%cC`s�tt|�j||�|jjdj||�d|j�tjj	t
|dd��sotd|��n|jdd||jd|g}g|D]}t
|dd�^q�}t
|�d	S(
s put a file from local to lxd uPUT {0} TO {1}R R(R)sinput path is not a file: %stfiletpusht/N(RR
tput_fileRR#R0RtostpathtisfileR
R	RR(Rtin_pathtout_pathR5R6((sB/usr/lib/python2.7/site-packages/ansible/plugins/connection/lxd.pyR;]s%#%cC`s�tt|�j||�|jjdj||�d|j�|jdd|jd||g}g|D]}t|dd�^qh}t	|�dS(	s  fetch a file from lxd to local uFETCH {0} TO {1}R R8tpullR:R(R)N(
RR
t
fetch_fileRR#R0RRR
R(RR?R@R5R6((sB/usr/lib/python2.7/site-packages/ansible/plugins/connection/lxd.pyRBls
%#%cC`s tt|�j�t|_dS(s+ close the connection (nothing to do here) N(RR
tclosetFalseR"(R((sB/usr/lib/python2.7/site-packages/ansible/plugins/connection/lxd.pyRCxsN(t__name__t
__module__t__doc__t	transportR$thas_pipeliningtdefault_userRR!RR/R;RBRC(((sB/usr/lib/python2.7/site-packages/ansible/plugins/connection/lxd.pyR
)s				(t
__future__RRRttypet
__metaclass__t
DOCUMENTATIONR<tdistutils.spawnRt
subprocessRRRtansible.errorsRRR	tansible.module_utils._textR
Rtansible.plugins.connectionRR
(((sB/usr/lib/python2.7/site-packages/ansible/plugins/connection/lxd.pyt<module>s

Anon7 - 2022
AnonSec Team