%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/ansible/plugins/terminal/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/ansible/plugins/terminal/__pycache__/__init__.cpython-39.pyc

a

�)gV�@sPddlmZmZmZeZddlZddlmZm	Z	ddl
mZGdd�de�ZdS)�)�absolute_import�division�print_functionN)�ABC�abstractmethod)�AnsibleConnectionFailurec@s�eZdZdZgZgZe�d�e�d�e�d�gZdZ	dZ
dZdd�Zdd	d
�Z
dd�Zd
d�Zdd�Zddd�Zdd�Zddd�Zdd�ZdS)�TerminalBasea�
    A base class for implementing cli connections

    .. note:: Unlike most of Ansible, nearly all strings in
        :class:`TerminalBase` plugins are byte strings.  This is because of
        how close to the underlying platform these plugins operate.  Remember
        to mark literal strings as byte string (``b"string"``) and to use
        :func:`~ansible.module_utils._text.to_bytes` and
        :func:`~ansible.module_utils._text.to_text` to avoid unexpected
        problems.
    s\x1b\[\?1h\x1b=s\x08.s\x1b\[mNTcCs
||_dS)N)�_connection)�selfZ
connection�r�E/usr/lib/python3.9/site-packages/ansible/plugins/terminal/__init__.py�__init__@szTerminalBase.__init__cCs|j�|�S)z�
        Executes the CLI command on the remote device and returns the output

        :arg cmd: Byte string command to be executed
        )r	Zexec_command)r
�cmdZcheck_rcrrr�_exec_cli_commandCszTerminalBase._exec_cli_commandcCs
|j��S)zk
        Returns the current prompt from the device

        :returns: A byte string of the prompt
        )r	Z
get_prompt�r
rrr�_get_promptKszTerminalBase._get_promptcCsdS)aCalled after the SSH session is established

        This method is called right after the invoke_shell() is called from
        the Paramiko SSHClient instance.  It provides an opportunity to setup
        terminal parameters such as disbling paging for instance.
        Nrrrrr�
on_open_shellSszTerminalBase.on_open_shellcCsdS)a&Called before the connection is closed

        This method gets called once the connection close has been requested
        but before the connection is actually closed.  It provides an
        opportunity to clean up any terminal resources before the shell is
        actually closed
        Nrrrrr�on_close_shell\szTerminalBase.on_close_shellcCsdS)a�Called when privilege escalation is requested

        :kwarg passwd: String containing the password

        This method is called when the privilege is requested to be elevated
        in the play context by setting become to True.  It is the responsibility
        of the terminal plugin to actually do the privilege escalation such
        as entering `enable` mode for instance
        Nr�r
�passwdrrr�	on_becomefs
zTerminalBase.on_becomecCsdS)aCalled when privilege deescalation is requested

        This method is called when the privilege changed from escalated
        (become=True) to non escalated (become=False).  It is the responsibility
        of this method to actually perform the deauthorization procedure
        Nrrrrr�on_unbecomerszTerminalBase.on_unbecomecCs
|�|�S)zjDeprecated method for privilege escalation

        :kwarg passwd: String containing the password
        )rrrrr�on_authorize{szTerminalBase.on_authorizecCs|��S)z5Deprecated method for privilege deescalation
        )rrrrr�on_deauthorize�szTerminalBase.on_deauthorize)T)N)N)�__name__�
__module__�__qualname__�__doc__Zterminal_stdout_reZterminal_stderr_re�re�compileZansi_reZterminal_initial_promptZterminal_initial_answerZterminal_inital_prompt_newliner
rrrrrrrrrrrrrs&
�
	

	
r)
Z
__future__rrr�typeZ
__metaclass__r�abcrrZansible.errorsrrrrrr�<module>s


Zerion Mini Shell 1.0