fabric.py 文件源码

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

项目:lambda-chef-node-cleanup 作者: awslabs 项目源码 文件源码
def chef_tags(*tags, **kwargs):
    """A decorator to use Chef node tags to find nodes to execute on.

    This is used like Fabric's ``roles()`` decorator, but accepts a list of tags.

    Example::

        from chef.fabric import chef_tags

        @chef_tags('active', 'migrator')
        @task
        def migrate():
            pass

    .. versionadded:: 0.2.1
    """
    # Allow passing a single iterable
    if len(tags) == 1 and not isinstance(tags[0], six.string_types):
        tags = tags[0]
    query = ' AND '.join('tags:%s'%tag.strip() for tag in tags)
    return chef_query(query, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号