File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/keystone.cpython-310.pyc
o
�N�g[� � @ s� d Z ddlZddlZdZz&ddlZddlmZ dZddl m
Z
ddlmZ ddlm
Z
ddlmZ W n ey; Y nw d ad
ae�e�Zdd� Zd_d
d�Zd_dd�Zd_dd�Z d`dd�Z dadd�Z dadd�Zdbdd�Zdbdd�Zd_dd�Z dcdd �Z dbd!d"�Z!d_d#d$�Z"dbd%d&�Z#dbd'd(�Z$d_d)d*�Z% ddd+d,�Z&dbd-d.�Z'dbd/d0�Z(d_d1d2�Z) ded3d4�Z* ded5d6�Z+dbd7d8�Z,dbd9d:�Z-dbd;d<�Z.dbd=d>�Z/d_d?d@�Z0d_dAdB�Z1 d`dCdD�Z2 d`dEdF�Z3d_dGdH�Z4d_dIdJ�Z5dbdKdL�Z6 dfdMdN�Z7dbdOdP�Z8 dgdQdR�Z9 dadSdT�Z: dadUdV�Z; dhdWdX�Z< dhdYdZ�Z= dcd[d\�Z>d_d]d^�Z?dS )iaf
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
keystone.password: verybadpass
keystone.tenant: admin
keystone.tenant_id: f80919baedab48ec8931f200c65a50df
keystone.auth_url: 'http://127.0.0.1:5000/v2.0/'
keystone.verify_ssl: True
OR (for token based authentication)
.. code-block:: yaml
keystone.token: 'ADMIN'
keystone.endpoint: 'http://127.0.0.1:35357/v2.0'
If configuration for multiple openstack accounts is required, they can be
set up as different configuration profiles. For example:
.. code-block:: yaml
openstack1:
keystone.user: admin
keystone.password: verybadpass
keystone.tenant: admin
keystone.tenant_id: f80919baedab48ec8931f200c65a50df
keystone.auth_url: 'http://127.0.0.1:5000/v2.0/'
keystone.verify_ssl: True
openstack2:
keystone.user: admin
keystone.password: verybadpass
keystone.tenant: admin
keystone.tenant_id: f80919baedab48ec8931f200c65a50df
keystone.auth_url: 'http://127.0.0.2:5000/v2.0/'
keystone.verify_ssl: True
With this configuration in place, any of the keystone functions can make use
of a configuration profile by declaring it explicitly.
For example:
.. code-block:: bash
salt '*' keystone.tenant_list profile=openstack1
� NF)�clientT��session)�generic)�discover� �tenantsc C s t rdS dS )zL
Only load this module if keystone
is installed on this minion.
Zkeystone)FzXkeystone execution module cannot be loaded: keystoneclient python library not available.)�HAS_KEYSTONE� r
r
�I/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/keystone.py�__virtual__P s r c s� | r| d �nd�d� �fdd� }|dd�}|dd �}|d
d�}|d�}|dd
�}|dd�}|d�} |dd�}
|dd�}|dd�}|dd�}
| rN| |
d�}n|||||||d�}|r^d|d<