%PDF- %PDF-
| Direktori : /proc/thread-self/root/proc/3522530/root/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/thread-self/root/proc/3522530/root/lib/python2.7/site-packages/salt/states/glassfish.pyo |
�
���^c @@ sr d Z d d l m Z m Z m Z yB d d l Z d d l m Z d d l m
Z
d d l Z e Z
Wn e k
r} e Z
n Xd � Z d � Z d � Z d d � Z d d
� Z d d e d
d d d d e d e d d � Z e d d � Z d d e d d � Z d d � Z d e d d d d d d d d d d e d e d d � Z e d d � Z d d � Z d d � Z d S( u&
Manage Glassfish/Payara server
.. versionadded:: Carbon
Management of glassfish using it's RESTful API
You can setup connection parameters like this
.. code-block:: yaml
- server:
- ssl: true
- url: localhost
- port: 4848
- user: admin
- password: changeit
i ( t absolute_importt print_functiont unicode_literalsN( t six( t CommandExecutionErrorc C@ s d t k o t S( u4
Only load if glassfish module is available
u glassfish.enum_connector_c_pool( t __salt__t HAS_LIBS( ( ( s9 /usr/lib/python2.7/site-packages/salt/states/glassfish.pyt __virtual__ s c C@ s� i } xt | j � D]f \ } } t | t j � so t | t � rS t | � | | <qy t j | � j � | | <q | | | <q W| S( u@
Encode json values in unicode to match that of the API
( t itemst
isinstanceR t text_typet dictt _json_to_unicodet lower( t datat rett keyt value( ( s9 /usr/lib/python2.7/site-packages/salt/states/glassfish.pyR $ s c C@ s i } t t j j j t j j j | d t �� � } t j j j t j j j | d t �� } x� | j � D]� \ } } t j | � j
� } | | k r� t j | | � j
� } n | d k s� | d k r� d } n | | k rm | | k rm i | d 6| d 6| | <qm qm W| S( u?
Compare the API results to the current statefile data
t ensure_asciiu nullu noneu u oldu new( R t saltt utilst jsont loadst dumpst FalseR R R
R
( t old_conft new_conft changedR R t oldvalt newval( ( s9 /usr/lib/python2.7/site-packages/salt/states/glassfish.pyt _is_updated4 s !* c C@ s� i i d 6t d 6t d 6d d 6} y t d j | � � } WnT t j k
r� } t d r� i | d 6| d 6| d <t | d <| Sd | d <| Sn X| s� | | k ri | d 6| d 6| d <t | d <t d s�y$ t d
j | � | d | | �Wqt k
r} | | d <| SXq�n� | r�t | � r�t d j | � | d | �} t
| | � } | r�t | d <| | d <t d s�y$ t d
j | � | d | | �Wq�t k
r�} | | d <q�Xq�q�n | S( u9
Generic function to create or update an element
u changesu updateu createu erroru glassfish.enum_{0}u testu Nameu Paramsu Can't connect to the serveru glassfish.create_{0}t serveru glassfish.get_{0}u glassfish.update_{0}N( R t NoneR t formatt requestst ConnectionErrort __opts__t TrueR t anyR ( t namet elem_typeR R R t elementst errort current_datat data_diff( ( s9 /usr/lib/python2.7/site-packages/salt/states/glassfish.pyt _do_element_presentJ s>