def is_provider_configured(opts, provider, required_keys=()):
 if (':' in provider):
  (alias, driver) = provider.split(':')
  if (alias not in opts['providers']):
   return False
  if (driver not in opts['providers'][alias]):
   return False
  for key in required_keys:
   if (opts['providers'][alias][driver].get(key, None) is None):
    log.warning("The required '{0}' configuration setting is missing from the '{1}' driver, which is configured under the '{2}' alias.".format(key, provider, alias))
    return False
  return opts['providers'][alias][driver]
 for (alias, drivers) in six.iteritems(opts['providers']):
  for (driver, provider_details) in six.iteritems(drivers):
   if (driver != provider):
    continue
   skip_provider = False
   for key in required_keys:
    if (provider_details.get(key, None) is None):
     log.warning("The required '{0}' configuration setting is missing from the '{1}' driver, which is configured under the '{2}' alias.".format(key, provider, alias))
     skip_provider = True
     break
   if skip_provider:
    continue
   return provider_details
 return False

def is_provider_configured ( opts , provider , required_keys = ( ) ) : if ( ':' in provider ) : ( alias , driver ) = provider . split ( ':' ) if ( alias not in opts [ 'providers' ] ) : return False if ( driver not in opts [ 'providers' ] [ alias ] ) : return False for key in required_keys : if ( opts [ 'providers' ] [ alias ] [ driver ] . get ( key , None ) is None ) : log . warning ( "The required '{0}' configuration setting is missing from the '{1}' driver, which is configured under the '{2}' alias." . format ( key , provider , alias ) ) return False return opts [ 'providers' ] [ alias ] [ driver ] for ( alias , drivers ) in six . iteritems ( opts [ 'providers' ] ) : for ( driver , provider_details ) in six . iteritems ( drivers ) : if ( driver != provider ) : continue skip_provider = False for key in required_keys : if ( provider_details . get ( key , None ) is None ) : log . warning ( "The required '{0}' configuration setting is missing from the '{1}' driver, which is configured under the '{2}' alias." . format ( key , provider , alias ) ) skip_provider = True break if skip_provider : continue return provider_details return False
check and return the first matching and fully configured cloud provider configuration .