/usr/lib/python2.6/site-packages/keystoneauth1/loading
Edit: /usr/lib/python2.6/site-packages/keystoneauth1/loading/cli.pyc (3690B)
Ņō
DVc @ sr d d k Z d d k Z d d k l Z d d k l Z d d g Z d Z e i d d Z d Z d S( i˙˙˙˙N( t _utils( t baset register_argparse_argumentst load_from_argparse_argumentsc C sS xL | i D]> } | i d | i d | i d | i d d | i | i q
Wd S( Nt defaultt metavart helpt dests os_%s( t get_optionst add_argumentt argparse_defaultR R R t
argparse_args( t parsert plugint opt( ( s@ /tmp/pip-build-lt8jXN/keystoneauth1/keystoneauth1/loading/cli.pyt# _register_plugin_argparse_arguments s
c
C sū t i d t } t i i d t i i d | } x6 | | f D]( } | i d d d d d | d d
qC W| i | \ } } | i p d St
| i t i o d } | i } n d | i } t i
| i } | i d
| }
t |
| | S( s 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 argparse.ArgumentParser: the parser to attach argparse options to.
: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: :py:class:`keystonauth.auth.BaseAuthPlugin`
:raises keystonauth.exceptions.NoMatchingPlugin: if a plugin cannot be
created.
t add_helpt OS_AUTH_TYPEt OS_AUTH_PLUGINs --os-auth-types --os-auth-pluginR s
R R s Authentication type to uses Default Authentication optionss" Options specific to the %s plugin.s Authentication OptionsN( t argparset ArgumentParsert Falset ost environt getR t parse_known_argst os_auth_typet Nonet
isinstanceR t
BaseLoadert get_plugin_loadert add_argument_groupR ( R t argvR t in_parsert
env_plugint pt optionst _argst msgR
t group( ( s@ /tmp/pip-build-lt8jXN/keystoneauth1/keystoneauth1/loading/cli.pyR ! s*
c K s´ | i p d St | i t o
| i } n t i | i } | i } xW | D]O } t | d | i } | d j o | i | } n | i | i | qT W| i
| S( sô 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: :py:class:`keystonauth.auth.BaseAuthPlugin`
:raises keystonauth.exceptions.NoMatchingPlugin: if a plugin cannot be
created.
s os_%sN( R R R t typeR R R t getattrR t
setdefaultt load_from_options( t namespacet kwargsR
t plugin_optsR t val( ( s@ /tmp/pip-build-lt8jXN/keystoneauth1/keystoneauth1/loading/cli.pyR N s
(
R R t
keystoneauth1R t utilst keystoneauth1.loadingR t __all__R t
positionalR R R ( ( ( s@ /tmp/pip-build-lt8jXN/keystoneauth1/keystoneauth1/loading/cli.pyt
s ,