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 : |
� ���cs � �r � d dl mZmZmZ eZdZdZdZd dl Z d dl mZ d dlm Z d dlmZ G d � d e � � ZdS )� )�absolute_import�division�print_functionaT name: together author: Bradley Young (!UNKNOWN) <young.bradley@gmail.com> version_added: '1.3' short_description: merges lists into synchronized list description: - Creates a list with the iterated elements of the supplied lists - "To clarify with an example, [ 'a', 'b' ] and [ 1, 2 ] turn into [ ('a',1), ('b', 2) ]" - This is basically the same as the 'zip_longest' filter and Python function - Any 'unbalanced' elements will be substituted with 'None' options: _terms: description: list of lists to merge required: True z� - name: item.0 returns from the 'a' list, item.1 returns from the '1' list ansible.builtin.debug: msg: "{{ item.0 }} and {{ item.1 }}" with_together: - ['a', 'b', 'c', 'd'] - [1, 2, 3, 4] zO _list: description: synchronized list type: list elements: list N)�AnsibleError)� LookupBase)�listify_lookup_plugin_termsc � � e Zd ZdZd� Zdd�ZdS )�LookupModulez� Transpose a list of arrays: [1, 2, 3], [4, 5, 6] -> [1, 4], [2, 5], [3, 6] Replace any empty spots in 2nd array with None: [1, 2], [3] -> [1, 3], [2, None] c �j � g }|D ]-}t || j �� � }|� |� � �.|S )N)�templar)r �_templar�append)�self�terms�results�x�intermediates �D/usr/lib/python3.11/site-packages/ansible/plugins/lookup/together.py�_lookup_variableszLookupModule._lookup_variables5 sD � ���� )� )�A�6�q�$�-�P�P�P�L��N�N�<�(�(�(�(��� Nc � � � � � |� � }|d d � }t |� � dk rt d� � �� fd�t j |dd i�D � � S )Nr z8with_together requires at least one element in each listc �: �� g | ]}�� |� � ��S � )�_flatten)�.0r r s �r � <listcomp>z$LookupModule.run.<locals>.<listcomp>D s% �� �Z�Z�Z�Q�� � �a� � �Z�Z�Zr � fillvalue)r �lenr � itertools�zip_longest)r r � variables�kwargs�my_lists ` r �runzLookupModule.run<