__init__.py 文件源码

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

项目:ansible-provider-docs 作者: alibaba 项目源码 文件源码
def is_template(self, data):
        ''' lets us know if data has a template'''
        if isinstance(data, string_types):
            try:
                new = self.do_template(data, fail_on_undefined=True)
            except (AnsibleUndefinedVariable, UndefinedError):
                return True
            except:
                return False
            return (new != data)
        elif isinstance(data, (list, tuple)):
            for v in data:
                if self.is_template(v):
                    return True
        elif isinstance(data, dict):
            for k in data:
                if self.is_template(k) or self.is_template(data[k]):
                    return True
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号