File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/mysql_user.cpython-310.pyc
Back
o ;j�% � @ sJ d Z ddlZddlZdd� Zdd� Z dd d�Zddd �ZdS )a. Management of MySQL users ========================= :depends: - MySQLdb Python module :configuration: See :py:mod:`salt.modules.mysql` for setup instructions. .. code-block:: yaml frank: mysql_user.present: - host: localhost - password: bobcat .. versionadded:: 0.16.2 Authentication overrides have been added. The MySQL authentication information specified in the minion config file can be overridden in states using the following arguments: ``connection_host``, ``connection_port``, ``connection_user``, ``connection_pass``, ``connection_db``, ``connection_unix_socket``, ``connection_default_file`` and ``connection_charset``. .. code-block:: yaml frank: mysql_user.present: - host: localhost - password: "bob@cat" - connection_user: someuser - connection_pass: somepass - connection_charset: utf8 - saltenv: - LC_ALL: "en_US.utf8" This state is not able to grant permissions for the user. See :py:mod:`salt.states.mysql_grants` for further instructions. � Nc C s dt v rdS dS )z6 Only load if the mysql module is in __salt__ �mysql.user_createT)Fz mysql module could not be loaded)�__salt__� r r �J/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/mysql_user.py�__virtual__0 s r c C s t jtd j j�dd�S )zp Look in module context for a MySQL error. Eventually we should make a less ugly way of doing this. z test.pingzmysql.errorN)�sys�modulesr � __module__�__context__�popr r r r �_get_mysql_error9 s �r � localhostF�mysql_native_passwordc K s� | i dd| � d|� d�d�} t ||f� } | rWtjj�|�s*|s*d| d<