File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/github.cpython-310.pyc
o
�N�g�� � @ st d Z ddlZddlZddlmZ dZzddlZddlZddl Zddl
mZ dZW n ey1 Y nw e�
e�ZdZdd � Zd
d� Zdd
� Zd`dd�Zdadd�Zdbdd�Zdbdd�Zdcdd�Zdcdd�Zdddd�Z dedd�Z ! dfd"d#�Z $ % dgd&d'�Z dhd(d)�Zd*d+� Zdbd,d-�Z dcd.d/�Z!dcd0d1�Z"dcd2d3�Z#dcd4d5�Z$ did6d7�Z% djd8d9�Z&dcd:d;�Z'dcd<d=�Z( dkd>d?�Z)dld@dA�Z*dcdBdC�Z+dbdDdE�Z,dmdFdG�Z-dcdHdI�Z.dbdJdK�Z/dbdLdM�Z0dcdNdO�Z1dcdPdQ�Z2dcdRdS�Z3dbdTdU�Z4 ! dndVdW�Z5dXdY� Z6dZd[� Z7 \ ] dod^d_�Z8dS )pa
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'github' key by default, if defined.
For example:
.. code-block:: yaml
github:
token: abc1234
org_name: my_organization
# optional: some functions require a repo_name, which
# can be set in the config file, or passed in at the CLI.
repo_name: my_repo
# optional: it can be dangerous to change the privacy of a repository
# in an automated way. set this to True to allow privacy modifications
allow_repo_privacy_changes: False
� N)�CommandExecutionErrorF)�UnknownObjectExceptionT�githubc C s t rtS dS )zH
Only load this module if PyGithub is installed on this minion.
)FzPThe github execution module cannot be loaded: PyGithub library is not installed.)�HAS_LIBS�__virtualname__� r r �G/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/github.py�__virtual__7 s r c C sD t d | �}|std�| ���|�|�}|du r td�|| ���|S )a!
Helper function that returns a profile's configuration value based on
the supplied configuration name.
profile
The profile name that contains configuration information.
config_name
The configuration item's name to use to return configuration values.
z
config.optionzCAuthentication information could not be found for the '{}' profile.Nz5The '{}' parameter was not found in the '{}' profile.)Z__salt__r �format�get)�profileZconfig_nameZconfigZconfig_valuer r r �_get_config_valueD s �
��r
c C s>