@run_once
def _load_sqlalchemy_models():
 keystone_root = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
 for (root, dirs, files) in os.walk(keystone_root):
  root = root[len(keystone_root):]
  if (root.endswith('backends') and ('sql.py' in files)):
   module_root = ('keystone.%s' % root.replace(os.sep, '.').lstrip('.'))
   module_components = module_root.split('.')
   module_without_backends = ''
   for x in range(0, (len(module_components) - 1)):
    module_without_backends += (module_components[x] + '.')
   module_without_backends = module_without_backends.rstrip('.')
   module_name = (module_root + '.sql')
   __import__(module_name)

@ run_once def _load_sqlalchemy_models ( ) : keystone_root = os . path . normpath ( os . path . join ( os . path . dirname ( __file__ ) , '..' , '..' , '..' ) ) for ( root , dirs , files ) in os . walk ( keystone_root ) : root = root [ len ( keystone_root ) : ] if ( root . endswith ( 'backends' ) and ( 'sql.py' in files ) ) : module_root = ( 'keystone.%s' % root . replace ( os . sep , '.' ) . lstrip ( '.' ) ) module_components = module_root . split ( '.' ) module_without_backends = '' for x in range ( 0 , ( len ( module_components ) - 1 ) ) : module_without_backends += ( module_components [ x ] + '.' ) module_without_backends = module_without_backends . rstrip ( '.' ) module_name = ( module_root + '.sql' ) __import__ ( module_name )
find all modules containing sqlalchemy models and import them .