%PDF- %PDF-
| Direktori : /proc/self/root/proc/3522530/root/lib/python2.7/site-packages/salt/runners/ |
| Current File : //proc/self/root/proc/3522530/root/lib/python2.7/site-packages/salt/runners/auth.pyo |
�
���^c @@ sh 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 Z d � Z
d � Z d S( uh
Authentication runner for creating, deleting, and managing eauth tokens.
.. versionadded:: 2016.11.0
i ( t absolute_importt print_functiont unicode_literalsNc K@ sR t j j t � } | j � s3 t j j d � � n t j j t � } | j | � S( uh
Create an eauth token using provided credentials
Non-root users may specify an expiration date -- if allowed via the
:conf_master:`token_expire_user_override` setting -- by passing an
additional ``token_expire`` param. This overrides the
:conf_master:`token_expire` setting of the same name in the Master config
and is how long a token should live in seconds.
CLI Example:
.. code-block:: shell
salt-run auth.mk_token username=saltdev password=saltdev eauth=auto
# Create a token valid for three years.
salt-run auth.mk_token username=saltdev password=saltdev eauth=auto \
token_expire=94670856
# Calculate the number of seconds using expr.
salt-run auth.mk_token username=saltdev password=saltdev eauth=auto \
token_expire=$(expr \( 365 \* 24 \* 60 \* 60 \) \* 3)
u Salt Master must be running.(
t saltt netapit NetapiClientt __opts__t _is_master_runningt
exceptionst SaltDaemonNotRunningt autht Resolvert mk_token( t loadR R
( ( s5 /usr/lib/python2.7/site-packages/salt/runners/auth.pyR s c C@ sB t j j t d | � } t j j | � r>