utils.py 文件源码

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

项目:jinjabread 作者: Inveracity 项目源码 文件源码
def is_proxy():
    '''
    Return True if this minion is a proxy minion.
    Leverages the fact that is_linux() and is_windows
    both return False for proxies.
    TODO: Need to extend this for proxies that might run on
    other Unices
    '''
    import __main__ as main
    # This is a hack.  If a proxy minion is started by other
    # means, e.g. a custom script that creates the minion objects
    # then this will fail.
    is_proxy = False
    try:
        if 'salt-proxy' in main.__file__:
            is_proxy = True
    except AttributeError:
        pass
    return is_proxy
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号