@removals.remove(message='keystoneclient auth plugins are deprecated. Use keystoneauth.', version='2.1.0', removal_version='3.0.0')
@positional()
def register_argparse_arguments(parser, argv, default=None):
 in_parser = argparse.ArgumentParser(add_help=False)
 env_plugin = os.environ.get('OS_AUTH_PLUGIN', default)
 for p in (in_parser, parser):
  p.add_argument('--os-auth-plugin', metavar='<name>', default=env_plugin, help='The auth plugin to load')
 (options, _args) = in_parser.parse_known_args(argv)
 if (not options.os_auth_plugin):
  return None
 if isinstance(options.os_auth_plugin, type):
  msg = 'Default Authentication options'
  plugin = options.os_auth_plugin
 else:
  msg = ('Options specific to the %s plugin.' % options.os_auth_plugin)
  plugin = base.get_plugin_class(options.os_auth_plugin)
 group = parser.add_argument_group('Authentication Options', msg)
 plugin.register_argparse_arguments(group)
 return plugin

@ removals . remove ( message = 'keystoneclient auth plugins are deprecated. Use keystoneauth.' , version = '2.1.0' , removal_version = '3.0.0' ) @ positional ( ) def register_argparse_arguments ( parser , argv , default = None ) : in_parser = argparse . ArgumentParser ( add_help = False ) env_plugin = os . environ . get ( 'OS_AUTH_PLUGIN' , default ) for p in ( in_parser , parser ) : p . add_argument ( '--os-auth-plugin' , metavar = '<name>' , default = env_plugin , help = 'The auth plugin to load' ) ( options , _args ) = in_parser . parse_known_args ( argv ) if ( not options . os_auth_plugin ) : return None if isinstance ( options . os_auth_plugin , type ) : msg = 'Default Authentication options' plugin = options . os_auth_plugin else : msg = ( 'Options specific to the %s plugin.' % options . os_auth_plugin ) plugin = base . get_plugin_class ( options . os_auth_plugin ) group = parser . add_argument_group ( 'Authentication Options' , msg ) plugin . register_argparse_arguments ( group ) return plugin
register cli options needed to create a plugin .