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)
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)
def test_parse_config_non_list_config(): parse.parse_config('invalid')
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'