HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/solrcloud.cpython-310.pyc
o

�N�g��@s"dZddlZdd�Zddd�ZdS)zV
States for solrcloud alias and collection configuration

.. versionadded:: 2017.7.0

�NcKs>|iddd�}td|fi|��rktd|fi|��}t|��t|��}t|�dkr4d|d<d	|d
<|StdrEd|�d
�|d
<d|d<ntd||fi|��d|�d�|d
<d|d<d�|�d�|�d�|d<|Stdr|d|�d�|d
<d|d<ntd||fi|��d|�d�|d
<d|d<dd�|�d�|d<|S)a*
    Create alias and enforce collection list.

    Use the solrcloud module to get alias members and set them.

    You can pass additional arguments that will be forwarded to http.query

    name
        The collection name
    collections
        list of collections to include in the alias
    F���name�changes�result�commentzsolrcloud.alias_existszsolrcloud.alias_get_collectionsrTrzAlias is in desired stater�testzThe alias "z" will be updated.Nzsolrcloud.alias_set_collectionsz" has been updated.�,��old�newr�" will be created.�" has been created.)�__salt__�set�
difference�len�__opts__�join)r�collections�kwargs�retZ
alias_content�diff�r�I/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/solrcloud.py�aliass@�

��

�rc	s�|iddd�}|dur
i}td|fi|��r�i}td|fi|��}gd���fdd	�|��D�}|D]\}}||vsB|||krF|||<q4t|�d
krWd|d<d
|d<|Stdrhd|�d�|d<d|d<ntd||fi|��d�|�|d<d|d<tjjj|dddd�tjjj|dddd�d�|d<|Stjjj|dddd�}tdr�d|�d�|d<d|d<ntd||fi|��d|�d�|d<d|d<dd|d�|d<|S)a	
    Create collection and enforce options.

    Use the solrcloud module to get collection parameters.

    You can pass additional arguments that will be forwarded to http.query

    name
        The collection name
    options : {}
        options to ensure
    FrrNzsolrcloud.collection_existsz solrcloud.collection_get_options)ZmaxShardsPerNodeZreplicationFactorZautoAddReplicaszcollection.configNameZruleZsnitchcsg|]}|�vr|�qSrr)�.0�k�Zupdatable_optionsrr�
<listcomp>mszcollection.<locals>.<listcomp>rTrz'Collection options are in desired staterrzCollection options "z" will be changed.z solrcloud.collection_set_optionsz,Parameters were updated for collection "{}".�)r	z: )�	sort_keys�indent�
separatorsr
rzThe collection "r
zsolrcloud.collection_createrzoptions=)	r�itemsrr�format�salt�utils�json�dumps)	r�optionsrrrZcurrent_options�key�valueZnew_changesrrr�
collectionFsb�	�
���
��

�r-)N)�__doc__Zsalt.utils.jsonr&rr-rrrr�<module>s;