%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/modules/ |
Current File : //lib/python2.7/site-packages/salt/modules/jira_mod.pyo |
� ���^c @@ sQ d Z d d l m Z m Z m Z d d l Z e j e � Z y d d l m Z Wn! e k rt d d l m Z n Xy d d l Z e Z Wn e k r� e Z n Xd Z d g Z d a d � Z d d d d � Z d d d d � Z d d d d d d d d d d d d � Z d d d d � Z d e d d d d � Z d d d d � Z d S( uG JIRA Execution module ===================== .. versionadded:: 2019.2.0 Execution module to manipulate JIRA tickets via Salt. This module requires the ``jira`` Python library to be installed. Configuration example: .. code-block:: yaml jira: server: https://jira.atlassian.org username: salt password: pass i ( t absolute_importt unicode_literalst print_functionN( t clean_kwargsu jirau *c C@ s t r t St d f S( Nu/ Please install the jira Python libary from PyPI( t HAS_JIRAt __virtualname__t False( ( ( s9 /usr/lib/python2.7/site-packages/salt/modules/jira_mod.pyt __virtual__. s c C@ sk t d d d i �} | s. | j d � } n | sF | j d � } n | s^ | j d � } n | | | f S( uN Returns the credentials merged with the config data (opts + pillar). u config.mergeu jirat defaultu serveru usernameu password( t __salt__t get( t servert usernamet passwordt jira_cfg( ( s9 /usr/lib/python2.7/site-packages/salt/modules/jira_mod.pyt _get_credentials2 s c C@ sU t sQ t d | d | d | � \ } } } t j d | | f d | d t � a n t S( NR R R t basic_autht logging( t JIRAR t jirat True( R R R ( ( s9 /usr/lib/python2.7/site-packages/salt/modules/jira_mod.pyt _get_jiraB s u jinjau baseu Bugu Normalc K@ s | rY t d | d | d | d | d | �} t d | d | d | d | d | �} n t d | d | d | � } | s� g } n i i | d 6d 6| d 6| d 6i | d 6d 6i | d 6d 6| d 6} | j t | � � | j | � } t | � } | rt | | � n | S( u� Create a JIRA issue using the named settings. Return the JIRA ticket ID. project The name of the project to attach the JIRA ticket to. summary The summary (title) of the JIRA ticket. When the ``template_engine`` argument is set to a proper value of an existing Salt template engine (e.g., ``jinja``, ``mako``, etc.) it will render the ``summary`` before creating the ticket. description The full body description of the JIRA ticket. When the ``template_engine`` argument is set to a proper value of an existing Salt template engine (e.g., ``jinja``, ``mako``, etc.) it will render the ``description`` before creating the ticket. template_engine: ``jinja`` The name of the template engine to be used to render the values of the ``summary`` and ``description`` arguments. Default: ``jinja``. context: ``None`` The context to pass when rendering the ``summary`` and ``description``. This argument is ignored when ``template_engine`` is set as ``None`` defaults: ``None`` Default values to pass to the Salt rendering pipeline for the ``summary`` and ``description`` arguments. This argument is ignored when ``template_engine`` is set as ``None``. saltenv: ``base`` The Salt environment name (for the rendering system). issuetype: ``Bug`` The type of the JIRA ticket. Default: ``Bug``. priority: ``Normal`` The priority of the JIRA ticket. Default: ``Normal``. labels: ``None`` A list of labels to add to the ticket. assignee: ``None`` The name of the person to assign the ticket to. CLI Examples: .. code-block:: bash salt '*' jira.create_issue NET 'Ticket title' 'Ticket description' salt '*' jira.create_issue NET 'Issue on {{ opts.id }}' 'Error detected on {{ opts.id }}' template_engine=jinja u file.apply_template_on_contentst templatet contextt defaultst saltenvR R R u keyu projectu summaryu descriptionu nameu issuetypeu priorityu labels( R R t updateR t create_issuet strt assign_issue( t projectt summaryt descriptiont template_engineR R R t issuetypet priorityt labelst assigneeR R R t kwargst jira_t datat issuet issue_key( ( s9 /usr/lib/python2.7/site-packages/salt/modules/jira_mod.pyR P s@ D c C@ s1 t d | d | d | � } | j | | � } | S( u= Assign the issue to an existing user. Return ``True`` when the issue has been properly assigned. issue_key The JIRA ID of the ticket to manipulate. assignee The name of the user to assign the ticket to. CLI Example: salt '*' jira.assign_issue NET-123 example_user R R R ( R R ( R* R% R R R R'