Exemplo n.º 1
0
def monitor_remote_configs(store, dataset, snapshot, realm=None):
    """Check remote configs and correct invalidities."""
    ds = store.get_dataset(dataset)
    siblings = ds.siblings()
    realm = get_dataset_realm(ds, siblings, realm)

    s3_ok = validate_s3_config(ds, realm)
    if not s3_ok:
        update_s3_sibling(ds, realm)
Exemplo n.º 2
0
def test_validate_s3_config(monkeypatch, no_init_remote, new_dataset):
    monkeypatch.setattr(datalad_service.config,
                        'AWS_S3_PUBLIC_BUCKET', 'a-fake-test-public-bucket')
    create_remotes(new_dataset.path)
    # Should fail since the no_init_remote version doesn't match the expected config
    assert not validate_s3_config(new_dataset.path)