Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/keystoneauth1/loading/__pycache__/cli.cpython-39.pyc
Ðазад
a s�hO � @ s� d dl Z d dlZd dlZd dlmZ ejrBd dlmZ d dlm Z dZ eje je j f ejd dd�dd �Zde jee ejejejd d �dd�Ze jejejd d �dd�ZdS )� N)�base)�opts)�plugin)�register_argparse_arguments�load_from_argparse_argumentszplugin.BaseAuthPluginT)�parserr �returnc C s8 |� � D ]*}| j|j|j|j|jd|j� �d�� qd S )N�os_)�default�metavar�help�dest)Zget_options�add_argumentZ argparse_argsZargparse_defaultr r r )r r �opt� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/keystoneauth1/loading/cli.py�#_register_plugin_argparse_arguments s �r )r �argvr r c C s� t jdd�}tj�dtj�d|��}|| fD ]}|jddd|dd � q,|�|�\}}|js^d S t|jt j �rxd}|j} nd|j� d �}t �|j�} | �d|�} t | | � | S )a� Register CLI options needed to create a plugin. The function inspects the provided arguments so that it can also register the options required for that specific plugin if available. :param parser: the parser to attach argparse options to. :type parser: argparse.ArgumentParser :param list argv: the arguments provided to the appliation. :param str/class default: a default plugin name or a plugin object to use if one isn't specified by the CLI. default: None. :returns: The plugin class that will be loaded or None if not provided. :rtype: :class:`keystoneauth1.loader.BaseLoader` :raises keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin: if a plugin cannot be created. F)�add_helpZOS_AUTH_TYPEZOS_AUTH_PLUGINz--os-auth-typez--os-auth-pluginz<name>zAuthentication type to use)r r r NzDefault Authentication optionszOptions specific to the z plugin.zAuthentication Options)�argparse�ArgumentParser�os�environ�getr �parse_known_args�os_auth_type� isinstancer � BaseLoader�get_plugin_loader�add_argument_groupr )r r r Z in_parserZ env_plugin�p�options�_args�msgr �groupr r r r ) s. �� r )� namespace�kwargsr c sR � j }|sdS t|tj�r |}n t�|�}dtjd�� fdd�}|j|fi |��S )a� Retrieve the created plugin from the completed argparse results. Loads and creates the auth plugin from the information parsed from the command line by argparse. :param Namespace namespace: The result from CLI parsing. :returns: An auth plugin, or None if a name is not provided. :rtype: :class:`keystoneauth1.plugin.BaseAuthPlugin` :raises keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin: if a plugin cannot be created. Nzopts.Opt)r r c s t � d| j� ��S )Nr )�getattrr )r �r% r r �_getterv s z-load_from_argparse_arguments.<locals>._getter)r r r r r �ty�AnyZload_from_options_getter)r% r&