def import_services_from_file(self, file_name, is_internal, base_dir): """ Imports all the services from the path to a file. """ deployed = [] try: mod_info = import_module_from_path(file_name, base_dir) except Exception, e: msg = 'Could not load source, file_name:`%s`, e:`%s`' logger.error(msg, file_name, format_exc(e))
def import_services_from_file(self, file_name, is_internal, base_dir): """ Imports all the services from the path to a file. """ deployed = [] try: mod_info = import_module_from_path(file_name, base_dir) except Exception: msg = 'Could not load source, file_name:`%s`, e:`%s`' logger.error(msg, file_name, format_exc()) else: deployed.extend(self._visit_module(mod_info.module, is_internal, mod_info.file_name)) finally: return deployed