def create_stores():
 store_count = 0
 store_classes = set()
 for store_entry in CONF.known_stores:
  store_entry = store_entry.strip()
  if (not store_entry):
   continue
  store_cls = _get_store_class(store_entry)
  store_instance = store_cls()
  schemes = store_instance.get_schemes()
  if (not schemes):
   raise BackendException(('Unable to register store %s. No schemes associated with it.' % store_cls))
  elif (store_cls not in store_classes):
   LOG.debug('Registering store %s with schemes %s', store_cls, schemes)
   store_classes.add(store_cls)
   scheme_map = {}
   for scheme in schemes:
    loc_cls = store_instance.get_store_location_class()
    scheme_map[scheme] = {'store_class': store_cls, 'location_class': loc_cls}
   location.register_scheme_map(scheme_map)
   store_count += 1
  else:
   LOG.debug('Store %s already registered', store_cls)
 return store_count

def create_stores ( ) : store_count = 0 store_classes = set ( ) for store_entry in CONF . known_stores : store_entry = store_entry . strip ( ) if ( not store_entry ) : continue store_cls = _get_store_class ( store_entry ) store_instance = store_cls ( ) schemes = store_instance . get_schemes ( ) if ( not schemes ) : raise BackendException ( ( 'Unable to register store %s. No schemes associated with it.' % store_cls ) ) elif ( store_cls not in store_classes ) : LOG . debug ( 'Registering store %s with schemes %s' , store_cls , schemes ) store_classes . add ( store_cls ) scheme_map = { } for scheme in schemes : loc_cls = store_instance . get_store_location_class ( ) scheme_map [ scheme ] = { 'store_class' : store_cls , 'location_class' : loc_cls } location . register_scheme_map ( scheme_map ) store_count += 1 else : LOG . debug ( 'Store %s already registered' , store_cls ) return store_count
registers all store modules and all schemes from the given config .