File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/netscaler.cpython-310.pyc
Back
o ;jl � @ s� d Z ddlZddlZz:ddlmZ ddlmZ ddlm Z ddl mZ ddlm Z ddlmZ dd lmZ dd lmZ ddlmZ dZW n eyO d ZY nw e�e�Zdd� Zdd� Zdd� Zdd� Zdd� Zd_dd�Z d_dd�Z!d`dd�Z"dd � Z#d_d!d"�Z$d#d$� Z%d%d&� Z&d'd(� Z'd)d*� Z(d+d,� Z)d-d.� Z*d/d0� Z+d1d2� Z,d3d4� Z-d_d5d6�Z.d7d8� Z/dad9d:�Z0d_d;d<�Z1d=d>� Z2d?d@� Z3dAdB� Z4dCdD� Z5dEdF� Z6dGdH� Z7dbdIdJ�Z8dKdL� Z9dMdN� Z:dOdP� Z;dQdR� Z<dSdT� Z=dUdV� Z>dWdX� Z?dYdZ� Z@d[d\� ZAd]d^� ZBdS )caD Module to provide Citrix Netscaler compatibility to Salt (compatible with netscaler 9.2+) .. versionadded:: 2015.2.0 :depends: - nsnitro Python module .. note:: You can install nsnitro using: .. code-block:: bash pip install nsnitro :configuration: This module accepts connection configuration details either as parameters, or as configuration settings in /etc/salt/minion on the relevant minions .. code-block:: yaml netscaler.host: 1.2.3.4 netscaler.user: user netscaler.pass: password This data can also be passed into pillar. Options passed into opts will overwrite options passed into pillar. CLI Examples: Calls relying on configuration passed using /etc/salt/minion, grains, or pillars: .. code-block:: bash salt-call netscaler.server_exists server_name Calls passing configuration as opts .. code-block:: bash salt-call netscaler.server_exists server_name netscaler_host=1.2.3.4 netscaler_user=username netscaler_pass=password salt-call netscaler.server_exists server_name netscaler_host=1.2.3.5 netscaler_user=username2 netscaler_pass=password2 salt-call netscaler.server_enable server_name2 netscaler_host=1.2.3.5 salt-call netscaler.server_up server_name3 netscaler_host=1.2.3.6 netscaler_useSSL=False � N)�NSNitroError)�NSNitro)�NSLBVServer)�NSLBVServerServiceGroupBinding)�NSServer)� NSService)�NSServiceGroup)�NSServiceGroupServerBinding)�NSSSLVServerSSLCertKeyBindingTFc C s t jj�� rdS trdS dS )zC Only load this module if the nsnitro library is installed )FzHThe netscaler execution module failed to load: not available on Windows.Z netscaler)Fz[The netscaler execution module failed to load: the nsnitro python library is not available.)�salt�utils�platformZ is_windows�HAS_NSNITRO� r r �J/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/netscaler.py�__virtual__M s r c s� t � � d� �fdd� }|dd� |dd� |dd � |d dd� t� d � d � d � d �}z|�� W |S tyO } z t�d |� W Y d}~dS d}~ww )z) Initialise netscaler connection Nc s� |du r| }| �v r�| � |<