• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.check_or_die函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中salt.utils.check_or_die函数的典型用法代码示例。如果您正苦于以下问题:Python check_or_die函数的具体用法?Python check_or_die怎么用?Python check_or_die使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: create

def create(path,
        venv_bin=__opts__['venv_bin'],
        no_site_packages=False,
        system_site_packages=False,
        distribute=False,
        clear=False,
        python='',
        extra_search_dir='',
        never_download=False,
        prompt='',
        runas=None):
    '''
    Create a virtualenv

    path
        The path to create the virtualenv
    venv_bin : 'virtualenv'
        The name (and optionally path) of the virtualenv command. This can also
        be set globally in the minion config file as ``virtualenv.venv_bin``.
    no_site_packages : False
        Passthrough argument given to virtualenv
    system_site_packages : False
        Passthrough argument given to virtualenv
    distribute : False
        Passthrough argument given to virtualenv
    clear : False
        Passthrough argument given to virtualenv
    python : (default)
        Passthrough argument given to virtualenv
    extra_search_dir : (default)
        Passthrough argument given to virtualenv
    never_download : (default)
        Passthrough argument given to virtualenv
    prompt : (default)
        Passthrough argument given to virtualenv
    runas : None
        Set ownership for the virtualenv

    CLI Example::

        salt '*' pip.virtualenv /path/to/new/virtualenv
    '''
    # raise CommandNotFoundError if venv_bin is missing
    utils.check_or_die(venv_bin)

    cmd = '{venv_bin} {args} {path}'.format(
            venv_bin=venv_bin,
            args=''.join([
                ' --no-site-packages' if no_site_packages else '',
                ' --system-site-packages' if system_site_packages else '',
                ' --distribute' if distribute else '',
                ' --clear' if clear else '',
                ' --python {0}'.format(python) if python else '',
                ' --extra-search-dir {0}'.format(extra_search_dir
                    ) if extra_search_dir else '',
                ' --never-download' if never_download else '',
                ' --prompt {0}'.format(prompt) if prompt else '']),
            path=path)

    return __salt__['cmd.run'](cmd, runas=runas)
开发者ID:cmek,项目名称:salt,代码行数:60,代码来源:virtualenv.py


示例2: _get_service_exec

def _get_service_exec():
    '''
    Debian uses update-rc.d to manage System-V style services.
    http://www.debian.org/doc/debian-policy/ch-opersys.html#s9.3.3
    '''
    executable = 'update-rc.d'
    utils.check_or_die(executable)
    return executable
开发者ID:Adapptor,项目名称:salt,代码行数:8,代码来源:upstart.py


示例3: _check_puppet

def _check_puppet():
    '''
    Checks if puppet is installed
    '''
    # I thought about making this a virtual module, but then I realized that I
    # would require the minion to restart if puppet was installed after the
    # minion was started, and that would be rubbish
    utils.check_or_die('puppet')
开发者ID:DamianZaremba,项目名称:salt,代码行数:8,代码来源:puppet.py


示例4: __virtual__

def __virtual__():
    '''
    Verify that tc (iproute) is installed
    '''
    try:
        utils.check_or_die('tc')
        return 'shaping'
    except:
        return False
开发者ID:tf198,项目名称:salt-states,代码行数:9,代码来源:shaping.py


示例5: __virtual__

def __virtual__():
    '''Verify RabbitMQ is installed.
    '''
    name = 'rabbitmq'
    try:
        utils.check_or_die('rabbitmqctl')
    except exceptions.CommandNotFoundError:
        name = False
    return name
开发者ID:herlo,项目名称:salt,代码行数:9,代码来源:rabbitmq.py


示例6: __virtual__

def __virtual__():
    '''
    Verify npm is installed.
    '''
    try:
        utils.check_or_die('npm')
        return 'npm'
    except exceptions.CommandNotFoundError:
        return False
开发者ID:Katafalkas,项目名称:states,代码行数:9,代码来源:npm.py


示例7: __virtual__

def __virtual__():
    '''
    Only load this module if the psql bin exists
    '''
    try:
        check_or_die('psql')
        return 'postgres'
    except CommandNotFoundError:
        return False
开发者ID:DamianZaremba,项目名称:salt,代码行数:9,代码来源:postgres.py


示例8: __virtual__

def __virtual__():
    """
    Only load this module if the psql bin exists
    """
    try:
        check_or_die("psql")
        return "postgres"
    except CommandNotFoundError:
        return False
开发者ID:rooprob,项目名称:salt,代码行数:9,代码来源:postgres.py


示例9: __virtual__

def __virtual__():
    '''
    Verify apt is installed.
    '''
    try:
        utils.check_or_die('apt-key')
        return 'apt_repository'
    except exceptions.CommandNotFoundError:
        return False
开发者ID:nigma,项目名称:salt-states,代码行数:9,代码来源:apt_repository.py


示例10: __virtual__

def __virtual__():
    """
    Check for supervisor.
    """
    try:
        utils.check_or_die("supervisorctl")
    except exceptions.CommandNotFoundError:
        return False

    return "supervisord"
开发者ID:Barrybaby,项目名称:salt,代码行数:10,代码来源:supervisord.py


示例11: __virtual__

def __virtual__():
    '''
    Check for supervisor.
    '''
    try:
        utils.check_or_die('supervisorctl')
    except exceptions.CommandNotFoundError:
        return False

    return 'supervisord'
开发者ID:BackSeat,项目名称:salt,代码行数:10,代码来源:supervisord.py


示例12: __virtual__

def __virtual__():
    """
    Only load if RabbitMQ is installed.
    """
    name = "rabbitmq_policy"
    try:
        utils.check_or_die("rabbitmqctl")
    except exceptions.CommandNotFoundError:
        name = False
    return name
开发者ID:penta-srl,项目名称:salt,代码行数:10,代码来源:rabbitmq_policy.py


示例13: __virtual__

def __virtual__():
    '''
    Verify PyRabbit and RabbitMQ are installed.
    '''
    try:
        utils.check_or_die('rabbitmqctl')
        log.debug("rabbitmqctl is available")
    except exceptions.CommandNotFoundError:
        log.error("rabbitmqctl is not available")
        name = False
    if not has_pyrabbit:
        log.error("pyrabbit is not available")
    return 'rabbitmq_cluster'
开发者ID:Katafalkas,项目名称:states,代码行数:13,代码来源:rabbitmq_cluster.py


示例14: __virtual__

def __virtual__():
    '''
    Verify PyRabbit and RabbitMQ are installed.
    '''
    command = 'rabbitmqctl'
    try:
        utils.check_or_die(command)
    except exceptions.CommandNotFoundError:
        log.debug("Can't find command '%s'", command)
        return False
    if not has_pyrabbit:
        log.debug("Can't find python module 'pyrabbit'")
        return False
    return 'rabbitmq_cluster'
开发者ID:Quarky9,项目名称:states,代码行数:14,代码来源:rabbitmq_cluster.py


示例15: _check_bzr

def _check_bzr():
    utils.check_or_die('bzr')
开发者ID:EmbeddedAndroid,项目名称:salt,代码行数:2,代码来源:bzr.py


示例16: _check_hg

def _check_hg():
    utils.check_or_die(hg_binary)
开发者ID:MadeiraCloud,项目名称:salt,代码行数:2,代码来源:hg.py


示例17: _check_hg

def _check_hg():
    utils.check_or_die('hg')
开发者ID:inthecloud247,项目名称:salt,代码行数:2,代码来源:hg.py


示例18: _check_svn

def _check_svn():
    '''
    Check for svn on this node.
    '''
    utils.check_or_die('svn')
开发者ID:1mentat,项目名称:salt,代码行数:5,代码来源:svn.py


示例19: _check_git

def _check_git():
    """
    Check if git is available
    """
    utils.check_or_die("git")
开发者ID:sijis,项目名称:salt,代码行数:5,代码来源:git.py


示例20: __virtual__

def __virtual__():
    try:
        check_or_die('nginx')
    except CommandNotFoundError:
        return False
    return 'nginx_site'
开发者ID:yumike,项目名称:pycon2013,代码行数:6,代码来源:nginx_site.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.namespaced_function函数代码示例发布时间:2022-05-27
下一篇:
Python template.compile_template函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap