def _openstack_auth_from_config(auth_plugin='password', **config):
 if (auth_plugin == 'rackspace'):
  plugin_class = RackspaceAuth
 else:
  plugin_class = get_plugin_class(auth_plugin)
 plugin_options = plugin_class.get_options()
 plugin_kwargs = {}
 for option in plugin_options:
  if (option.dest in config):
   plugin_kwargs[option.dest] = config[option.dest]
 return plugin_class(**plugin_kwargs)

def _openstack_auth_from_config ( auth_plugin = 'password' , ** config ) : if ( auth_plugin == 'rackspace' ) : plugin_class = RackspaceAuth else : plugin_class = get_plugin_class ( auth_plugin ) plugin_options = plugin_class . get_options ( ) plugin_kwargs = { } for option in plugin_options : if ( option . dest in config ) : plugin_kwargs [ option . dest ] = config [ option . dest ] return plugin_class ( ** plugin_kwargs )
create an openstack authentication plugin from the given configuration .