def get_template_context(self): """ 获取所有template配置数据 :return: """ return HostNodeTemplateMixin.get_multi_obj_context( pk_list=self.get_template_list())
def get_multi_host_group_full_context(cls, host_pk_list): """ 获取多个主机组的完整数据 """ full_context = {} for host_group_context in cls.get_multi_obj_context(pk_list=host_pk_list): host_group_full_context = {} [host_group_full_context.update(template_context) for template_context in HostNodeTemplateMixin.get_multi_obj_context(pk_list=host_group_context['template_list'])] host_group_full_context.update(host_group_context) full_context.update(host_group_full_context) return full_context
def get_multi_host_group_full_context(cls, host_pk_list): """ 获取多个主机组的完整数据 """ full_context = {} for host_group_context in cls.get_multi_obj_context( pk_list=host_pk_list): host_group_full_context = {} [ host_group_full_context.update(template_context) for template_context in HostNodeTemplateMixin.get_multi_obj_context( pk_list=host_group_context['template_list']) ] host_group_full_context.update(host_group_context) full_context.update(host_group_full_context) return full_context
def get_template_context(self): """ 获取所有template配置数据 :return: """ return HostNodeTemplateMixin.get_multi_obj_context(pk_list=self.get_template_list())