Python fabric.api.env 模块,use_ssh_config() 实例源码

我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用fabric.api.env.use_ssh_config()

项目:service-notifications    作者:rehive    | 项目源码 | 文件源码
def set_env(config, version_tag=None):
    """
    Fabric environmental variable setup
    """
    # Bug: when setting this inside a function. Using host_string as workaround
    config_dict = get_config(config)
    env.hosts = [config_dict['HOST_NAME'], ]
    env.host_string = config_dict['HOST_NAME']

    env.project_name = config_dict['PROJECT_NAME']
    env.project_dir = posixpath.join('/srv/images/', env.project_name)
    env.use_ssh_config = True

    env.image_name = config_dict['IMAGE'].split(':')[0]
    env.base_image_name = env.image_name + '_base'
    env.version_tag = version_tag

    env.build_dir = '/srv/build'
    env.local_path = os.path.dirname(__file__)
项目:service-notifications    作者:rehive    | 项目源码 | 文件源码
def set_env(config, version_tag=None):
    """
    Fabric environmental variable setup
    """
    # Bug: when setting this inside a function. Using host_string as workaround
    config_dict = get_config(config)
    env.hosts = [config_dict['HOST_NAME'], ]
    env.host_string = config_dict['HOST_NAME']

    env.project_name = config_dict['PROJECT_NAME']
    env.project_dir = posixpath.join('/srv/images/', env.project_name)
    env.use_ssh_config = True

    env.image_name = config_dict['IMAGE'].split(':')[0]
    env.base_image_name = env.image_name + '_base'
    env.version_tag = version_tag

    env.build_dir = '/srv/build'
    env.local_path = os.path.dirname(__file__)
项目:CommunityCellularManager    作者:facebookincubator    | 项目源码 | 文件源码
def proxy():
    """ Use SOCKS proxy for ssh from dev servers """
    env.ssh_config_path = "../client/ssh/proxy-config"
    env.use_ssh_config = True
项目:astoptool    作者:zouliuyun    | 项目源码 | 文件源码
def set_fabric_common_env():
    """
    ??????????fabric env
    """
    env.user = 'astd'
    env.use_ssh_config = True   # This is important when running under root.
    env.connection_attempts = 5
    env.disable_known_hosts = True
    env.keepalive = 60