
    Vh	                    h    d Z ddlmZ ddlZddlmZ ddlmZ ddl	m
Z
 ddlmZ d Z G d d	e      Zy)
z9 This manages remote shared Ansible objects, mainly roles    )annotationsN)context)to_bytes)	yaml_loadc                     t         j                  j                  t         j                  j                  t              dd      } t        t        | d      d      5 }t        |      cd d d        S # 1 sw Y   y xY w)Ndatazcollections_galaxy_meta.ymlsurrogate_or_strict)errorsrb)ospathjoindirname__file__openr   r   )	meta_path
galaxy_objs     G/home/dcms/DCMS/lib/python3.12/site-packages/ansible/galaxy/__init__.py get_collections_galaxy_meta_infor   $   sW    RWW__X6@]^I	hy)>?	F %*$% % %s   A//A8c                  2    e Zd ZdZd Zed        Zd Zd Zy)Galaxyz Keeps global galaxy info c                   t         j                  j                  dt        j                        }|| _        i | _        t        j                  j                  t              \  }}t         j                  j                  dd      }|dk(  r=t        j                  j                  |t         j                  j                  d            }t        j                  j                  |d|      | _        y )N
roles_path	role_typedefaulttyper   )r   CLIARGSgetCDEFAULT_ROLES_PATHroles_pathsrolesr   r   splitr   r   	DATA_PATH)selfr   this_dirthis_filename	type_paths        r   __init__zGalaxy.__init__-   s     __((q7K7KL
%
 #%''--"9-OO''Y?		!Y0C0CF0KLIh	B    c                    | j                   S N)r$   )r%   s    r   default_role_skeleton_pathz!Galaxy.default_role_skeleton_path?   s    ~~r*   c                6    || j                   |j                  <   y r,   )r"   name)r%   roles     r   add_rolezGalaxy.add_roleC   s     $

499r*   c                    | j                   |= y r,   )r"   )r%   	role_names     r   remove_rolezGalaxy.remove_roleF   s    JJy!r*   N)	__name__
__module____qualname____doc__r)   propertyr-   r1   r4    r*   r   r   r   *   s)    $C$  %"r*   r   )r8   
__future__r   r   ansible.constants	constantsr   ansibler   +ansible.module_utils.common.text.convertersr    ansible.module_utils.common.yamlr   r   objectr   r:   r*   r   <module>rB      s.   * @ " 	   @ 6%"V "r*   