Exemple #1
0
def run(config, dryrun=False, rsync=False, concurrency=None,
        access_key_id=None, secret_access_key=None,):

    if access_key_id is not None:
        os.environ['AWS_ACCESS_KEY_ID'] = access_key_id
    if secret_access_key is not None:
        os.environ['AWS_SECRET_ACCESS_KEY'] = secret_access_key

    config = load_config(config)
    buckets = parse_config(config)

    log.info(title)

    for b in buckets:
        if concurrency is not None:
            b.conn.concurrency = concurrency
        b.sync(dryrun=dryrun, rsync=rsync)
Exemple #2
0
def run(config,
        dryrun=False,
        rsync=False,
        concurrency=None,
        access_key_id=None,
        secret_access_key=None,
        temporary_security_token=None):

    if access_key_id is not None:
        os.environ['AWS_ACCESS_KEY_ID'] = access_key_id
    if secret_access_key is not None:
        os.environ['AWS_SECRET_ACCESS_KEY'] = secret_access_key

    config = load_config(config)
    buckets = parse_config(config)

    log.info(title)

    for b in buckets:
        if concurrency is not None:
            b.conn.concurrency = concurrency
        if temporary_security_token is not None:
            b.conn.temporary_security_token = temporary_security_token
        b.sync(dryrun=dryrun, rsync=rsync)
Exemple #3
0
def test_parse_config_non_list_config():
    parse.parse_config('invalid')
Exemple #4
0
def test_parse_config_success():
    bucket_config = {'bucket': 'test'}
    config = [bucket_config for r in range(10)]
    buckets = parse.parse_config(config)
    assert len(buckets) == 10
    assert buckets[0].name == 'test'
Exemple #5
0
def test_parse_config_success():
    bucket_config = {'bucket': 'test'}
    config = [bucket_config for r in range(10)]
    buckets = parse.parse_config(config)
    assert len(buckets) == 10
    assert buckets[0].name == 'test'
Exemple #6
0
def test_parse_config_non_list_config():
    parse.parse_config('invalid')