task_assign.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:lustre_task_driven_monitoring_framework 作者: GSI-HPC 项目源码 文件源码
def _create_body(task, task_class):

        body = None

        args_list = inspect.getargspec(task_class.__init__).args
        len_args_list = len(args_list)

        # Skip first parameter 'self' of the __init__ method which is a convention in Python for that method.
        if len_args_list > 1:

            body = str(getattr(task, args_list[1]))

            if len_args_list > 2:

                # Ordering of the arguments from the __init__ method is relevant!
                # getattr throws an exception if an argument is not found in the task object.
                for index in range(2, len(args_list)):
                    body += BaseMessage.field_separator + str(getattr(task, args_list[index]))

        return body
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号