コード例 #1
0
def partition_agent(hostname):
    """Partition a node from all network traffic except for SSH and loopback"""

    shakedown.copy_file_to_agent(
        hostname, "{}/net-services-agent.sh".format(fixture_dir()))
    print("partitioning {}".format(hostname))
    shakedown.run_command_on_agent(hostname, 'sh net-services-agent.sh fail')
コード例 #2
0
def copy_docker_credentials_file(agents, file_name='docker.tar.gz'):
    """Create and copy docker credentials file to passed `{agents}`. Used to access private
       docker repositories in tests. File is removed at the end.

       :param agents: list of agent IPs to copy the file to
       :type agents: list
    """

    assert os.path.isfile(
        file_name), "Failed to upload credentials: file {} not found".format(
            file_name)

    # Upload docker.tar.gz to all private agents
    try:
        print(
            'Uploading tarball with docker credentials to all private agents...'
        )
        for agent in agents:
            print("Copying docker credentials to {}".format(agent))
            shakedown.copy_file_to_agent(agent, file_name)
    except Exception as e:
        print('Failed to upload {} to agent: {}'.format(file_name, agent))
        raise e
    finally:
        os.remove(file_name)
コード例 #3
0
ファイル: common.py プロジェクト: guenter/marathon
def copy_docker_credentials_file(agents, file_name='docker.tar.gz'):
    """Create and copy docker credentials file to passed `{agents}`. Used to access private
       docker repositories in tests. File is removed at the end.

       :param agents: list of agent IPs to copy the file to
       :type agents: list
    """

    assert os.path.isfile(file_name), "Failed to upload credentials: file {} not found".format(file_name)

    # Upload docker.tar.gz to all private agents
    try:
        print('Uploading tarball with docker credentials to all private agents...')
        for agent in agents:
            print("Copying docker credentials to {}".format(agent))
            shakedown.copy_file_to_agent(agent, file_name)
    except Exception as e:
        print('Failed to upload {} to agent: {}'.format(file_name, agent))
        raise e
    finally:
        os.remove(file_name)
コード例 #4
0
def partition_agent(hostname):
    """Partition a node from all network traffic except for SSH and loopback"""

    shakedown.copy_file_to_agent(hostname, "{}/net-services-agent.sh".format(fixture_dir()))
    print("partitioning {}".format(hostname))
    shakedown.run_command_on_agent(hostname, 'sh net-services-agent.sh fail')