71
72
"""Returns a class from a string including module and class"""
72
73
mod_str, _sep, class_str = import_str.rpartition('.')
75
77
return getattr(sys.modules[mod_str], class_str)
77
80
raise exception.NotFound('Class %s cannot be found' % class_str)