当前位置: 首页>>代码示例>>Python>>正文


Python Block.deserialize方法代码示例

本文整理汇总了Python中ansible.playbook.block.Block.deserialize方法的典型用法代码示例。如果您正苦于以下问题:Python Block.deserialize方法的具体用法?Python Block.deserialize怎么用?Python Block.deserialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ansible.playbook.block.Block的用法示例。


在下文中一共展示了Block.deserialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: deserialize

# 需要导入模块: from ansible.playbook.block import Block [as 别名]
# 或者: from ansible.playbook.block.Block import deserialize [as 别名]
    def deserialize(self, data):

        # import is here to avoid import loops
        #from ansible.playbook.task_include import TaskInclude

        block_data = data.get('block')

        if block_data:
            b = Block()
            b.deserialize(block_data)
            self._block = b
            del data['block']

        role_data = data.get('role')
        if role_data:
            r = Role()
            r.deserialize(role_data)
            self._role = r
            del data['role']

        ti_data = data.get('task_include')
        if ti_data:
            #ti = TaskInclude()
            ti = Task()
            ti.deserialize(ti_data)
            self._task_include = ti
            del data['task_include']

        super(Task, self).deserialize(data)
开发者ID:RajeevNambiar,项目名称:temp,代码行数:31,代码来源:task.py

示例2: deserialize

# 需要导入模块: from ansible.playbook.block import Block [as 别名]
# 或者: from ansible.playbook.block.Block import deserialize [as 别名]
    def deserialize(self, data):

        # import is here to avoid import loops
        from ansible.playbook.task_include import TaskInclude
        from ansible.playbook.handler_task_include import HandlerTaskInclude

        parent_data = data.get('parent', None)
        if parent_data:
            parent_type = data.get('parent_type')
            if parent_type == 'Block':
                p = Block()
            elif parent_type == 'TaskInclude':
                p = TaskInclude()
            elif parent_type == 'HandlerTaskInclude':
                p = HandlerTaskInclude()
            p.deserialize(parent_data)
            self._parent = p
            del data['parent']

        role_data = data.get('role')
        if role_data:
            r = Role()
            r.deserialize(role_data)
            self._role = r
            del data['role']

        super(Task, self).deserialize(data)
开发者ID:KMK-ONLINE,项目名称:ansible,代码行数:29,代码来源:task.py


注:本文中的ansible.playbook.block.Block.deserialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。