def dynamic_class_import(class_path):
<EOL>try:<EOL><INDENT>tmp = class_path.split("<STR_LIT:.>")<EOL>module_path = "<STR_LIT:.>".join(tmp[<NUM_LIT:0>:-<NUM_LIT:1>])<EOL>package = __import__(module_path)<EOL>return reduce(getattr, tmp[<NUM_LIT:1>:], package)<EOL><DEDENT>except Exception as e:<EOL><INDENT>log.exception(e)<EOL>log.error(LOGMSG_ERR_FAB_ADDON_IMPORT.format(class_path, e))<EOL><DEDENT>
Will dynamically import a class from a string path
:param class_path: string with class path
:return: class