%PDF- %PDF-
| Direktori : /proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/states/github.pyo |
�
���^c @@ s d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l m Z d d l
m Z d d l m
Z
e j e � Z d � Z d d � Z d d
� Z d d d d d e d d d
� Z d � Z d d � Z d d d d d d e d d d d d � Z d d � Z d S( uK
Github User State Module
.. versionadded:: 2016.3.0.
This state is used to ensure presence of users in the Organization.
.. code-block:: yaml
ensure user test is present in github:
github.present:
- name: 'Example TestUser1'
- email: example@domain.com
- username: 'gitexample'
i ( t absolute_importt unicode_literalst print_functionN( t six( t CommandExecutionError( t rangec C@ s d t k r d St S( uA
Only load if the github module is available in __salt__
u github.list_usersu github( t __salt__t False( ( ( s6 /usr/lib/python2.7/site-packages/salt/states/github.pyt __virtual__! s u githubc K@ s} i | d 6i d 6d d 6d d 6} t d | d | | �} | sa t | d <d j | � | d <nt | t � r� | r� d j | � | d <t | d <n� | j d
t � r\| j d � d k r\t d
r� d j | � | d <| St d | d | | �} | r<| d j d d � | d j d d j | � � t | d <qyt | d <d j | � | d <n d j | � | d <t | d <| S( u%
Ensure a user is present
.. code-block:: yaml
ensure user test is present in github:
github.present:
- name: 'gitexample'
The following parameters are required:
name
This is the github handle of the user in the organization
u nameu changesu resultu u commentu github.get_usert profileu Couldnt find user {0}u User {0} is already in the org u in_orgu membership_stateu pendingu testu! User {0} will be added to the orgu github.add_useru oldu newu User {0} exists in the org nowu! Failed to add user {0} to the orgu"