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/plugins/lookup/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.11/site-packages/ansible/plugins/lookup/__pycache__/sequence.cpython-311.opt-1.pyc
�

���c�#���ddlmZmZmZeZdZdZdZddl	m
ZmZddl
mZddlmZddlmZd	Zed
ezdzezdzezd
zdze��ZGd�de��ZdS)�)�absolute_import�division�print_functiona 
    name: sequence
    author: Jayson Vantuyl (!UNKNOWN) <jayson@aggressive.ly>
    version_added: "1.0"
    short_description: generate a list based on a number sequence
    description:
      - generates a sequence of items. You can specify a start value, an end value, an optional "stride" value that specifies the number of steps
        to increment the sequence, and an optional printf-style format string.
      - 'Arguments can be specified as key=value pair strings or as a shortcut form of the arguments string is also accepted: [start-]end[/stride][:format].'
      - 'Numerical values can be specified in decimal, hexadecimal (0x3f8) or octal (0600).'
      - Starting at version 1.9.2, negative strides are allowed.
      - Generated items are strings. Use Jinja2 filters to convert items to preferred type, e.g. C({{ 1 + item|int }}).
      - See also Jinja2 C(range) filter as an alternative.
    options:
      start:
        description: number at which to start the sequence
        default: 0
        type: integer
      end:
        description: number at which to end the sequence, dont use this with count
        type: integer
        default: 0
      count:
        description: number of elements in the sequence, this is not to be used with end
        type: integer
        default: 0
      stride:
        description: increments between sequence numbers, the default is 1 unless the end is less than the start, then it is -1.
        type: integer
      format:
        description: return a string with the generated number formatted in
a&
- name: create some test users
  ansible.builtin.user:
    name: "{{ item }}"
    state: present
    groups: "evens"
  with_sequence: start=0 end=32 format=testuser%02x

- name: create a series of directories with even numbers for some reason
  ansible.builtin.file:
    dest: "/var/stuff/{{ item }}"
    state: directory
  with_sequence: start=4 end=16 stride=2

- name: a simpler way to use the sequence plugin create 4 groups
  ansible.builtin.group:
    name: "group{{ item }}"
    state: present
  with_sequence: count=4

- name: the final countdown
  ansible.builtin.debug:
    msg: "{{item}} seconds to detonation"
  with_sequence: start=10 end=0 stride=-1

- name: Use of variable
  ansible.builtin.debug:
    msg: "{{ item }}"
  with_sequence: start=1 end="{{ end_at }}"
  vars:
    - end_at: 10
zr
  _list:
    description:
      - A list containing generated sequence of items
    type: list
    elements: str
)�compile�
IGNORECASE)�AnsibleError)�parse_kv)�
LookupBasez(0?x?[0-9a-f]+)z^(z-)?z(/z)?z	(:(.+))?$c�6�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�LookupModulea{
    sequence lookup module

    Used to generate some sequence of items. Takes arguments in two forms.

    The simple / shortcut form is:

      [start-]end[/stride][:format]

    As indicated by the brackets: start, stride, and format string are all
    optional.  The format string is in the style of printf.  This can be used
    to pad with zeros, format in hexadecimal, etc.  All of the numerical values
    can be specified in octal (i.e. 0664) or hexadecimal (i.e. 0x3f8).
    Negative numbers are not supported.

    Some examples:

      5 -> ["1","2","3","4","5"]
      5-8 -> ["5", "6", "7", "8"]
      2-10/2 -> ["2", "4", "6", "8", "10"]
      4:host%02d -> ["host01","host02","host03","host04"]

    The standard Ansible key-value form is accepted as well.  For example:

      start=5 end=11 stride=2 format=0x%02x -> ["0x05","0x07","0x09","0x0a"]

    This format takes an alternate form of "end" called "count", which counts
    some number from the starting value.  For example:

      count=5 -> ["1", "2", "3", "4", "5"]
      start=0x0f00 count=4 format=%04x -> ["0f00", "0f01", "0f02", "0f03"]
      start=0 count=5 stride=2 -> ["0", "2", "4", "6", "8"]
      start=1 count=5 stride=2 -> ["1", "3", "5", "7", "9"]

    The count option is mostly useful for avoiding off-by-one errors and errors
    calculating the number of entries in a sequence when a stride is specified.
    c�L�d|_d|_d|_d|_d|_dS)zset sensible defaults�Nz%d)�start�count�end�stride�format��selfs �D/usr/lib/python3.11/site-packages/ansible/plugins/lookup/sequence.py�resetzLookupModule.reset�s)����
���
������������c	�p�dD]a}	|�|d��}|��t|d��}t|||���>#t$rt	d|�d|�d����wxYwd|vr|�d��|_|r1t	dt
|�����z���dS)	zparse key-value style arguments)rrrrNrzcan't parse �=z as integerrz+unrecognized arguments to with_sequence: %s)�pop�int�setattr�
ValueErrorrr�list�keys)r�args�arg�arg_raw�
arg_cookeds     r�
parse_kv_argszLookupModule.parse_kv_args�s���6�	�	�C�

��(�(�3��-�-���?�� ��!�_�_�
���c�:�.�.�.�.���
�
�
�"�l��s�s�G�G�G�%����
����
�t����(�(�8�,�,�D�K��	��=��t�y�y�{�{�#�#�$���
�	�	s�A�!A�!A"c��t�|��}|sdS|���\}}}}}}}|�2	t|d��}n #t$rtd|z���wxYw|�2	t|d��}n #t$rtd|z���wxYw|�2	t|d��}n #t$rtd|z���wxYw|�||_|�||_|�||_|�||_	dS)z+parse the shortcut forms, return True/FalseFNrzcan't parse start=%s as integerzcan't parse end=%s as integerz can't parse stride=%s as integerT)
�SHORTCUT�match�groupsrrrrrrr)r�termr(�_rrrrs        r�parse_simple_argszLookupModule.parse_simple_args�s_�����t�$�$���	��5�.3�l�l�n�n�+��5�#�q�&�!�V���
N��E�1�
�
�����
N�
N�
N�"�#D�u�#L�M�M�M�
N�����?�
J��#�q�k�k�����
J�
J�
J�"�#B�S�#H�I�I�I�
J������
P��V�Q�������
P�
P�
P�"�#E��#N�O�O�O�
P�������D�J��?��D�H��� �D�K��� �D�K��ts#�A�A,�2B�B �&B7�7Cc��|j�|j�td���|j�|j�td���|j�B|jdkr |j|j|jzzdz
|_nd|_d|_d|_|`|jdkr|j|jkrtd���|jdkr|j|jkrtd���|j�d��dkrtd|jz���dS)	Nz*must specify count or end in with_sequencez1can't specify both count and end in with_sequencerrz'to count backwards make stride negativez+to count forward don't make stride negative�%zbad formatting string: %s)rrrrrrrs r�sanity_checkzLookupModule.sanity_check�s���:��$�(�"2��K�L�L�L�
�Z�
#���(<��R�S�S�S�
�Z�
#��z�Q����:��
�T�[�(@�@�1�D������
��������
��;��?�?�t�x�$�*�4�4��H�I�I�I��;��?�?�t�x�$�*�4�4��L�M�M�M��;���S�!�!�Q�&�&��:�T�[�H�I�I�I�'�&rc#�K�|jdkrd}nd}t|j|j|z|j��}|D]@}	|j|z}|V��#t
tf$rtd|�d|j�����wxYwdS)Nrr���zproblem formatting z with )r�rangerrrr�	TypeErrorr)r�adjust�numbers�i�	formatteds     r�generate_sequencezLookupModule.generate_sequence�s������;�!����F�F��F���
�D�H�v�$5�t�{�C�C���	�	�A�
� �K�!�O�	��������	�*�
�
�
�"�l�78�q�q�$�+�+�F����
����		�	s�A
�
,A6c��g}|D]�}	|���	|�|��s"|�t|����n1#t$r�t
$r}t	d|�d|�����d}~wwxYw|���|jdkr'|�|�	������#t$r�t
$r}t	d|z���d}~wwxYw|S)Nz/unknown error parsing with_sequence arguments: z
. Error was: rz%unknown error generating sequence: %s)
rr,r%r	r�	Exceptionr/r�extendr8)r�terms�	variables�kwargs�resultsr*�es       r�runzLookupModule.run�sL�����	�	�D�
��
�
����w��1�1�$�7�7�;��*�*�8�D�>�>�:�:�:���#����� �w�w�w�&�,�mq�mq�mq�st�st�'u�v�v�v�����w�����!�!�#�#�#��;�!�#�#��N�N�4�#9�#9�#;�#;�<�<�<����
�
�
���
�
�
�"�;�a�?��������
����
�s;�C
�7A�C
�B�)A>�>B�A	C
�
C8�!C3�3C8N)
�__name__�
__module__�__qualname__�__doc__rr%r,r/r8rA�rrrrgs}������$�$�L������,!�!�!�FJ�J�J�*��� ����rrN)�
__future__rrr�type�
__metaclass__�
DOCUMENTATION�EXAMPLES�RETURN�rer�
re_compiler�ansible.errorsr�ansible.parsing.splitterr	�ansible.plugins.lookupr
�NUMr'rrFrr�<module>rSs2��C�B�B�B�B�B�B�B�B�B��
��
�B��B
��1�0�0�0�0�0�0�0�'�'�'�'�'�'�-�-�-�-�-�-�-�-�-�-�-�-����:����	�
���	�		�
��	�
	����
�
��e�e�e�e�e�:�e�e�e�e�er

Youez - 2016 - github.com/yon3zu
LinuXploit