diff --git a/glance_store/backend.py b/glance_store/backend.py index cffcf19b..5e53f6ef 100644 --- a/glance_store/backend.py +++ b/glance_store/backend.py @@ -532,6 +532,15 @@ def add_to_backend(conf, image_id, data, size, scheme=None, context=None, verifier) +def add_to_backend_with_multihash(conf, image_id, data, size, hashing_algo, + scheme=None, context=None, verifier=None): + if scheme is None: + scheme = conf['glance_store']['default_store'] + store = get_store_from_scheme(scheme) + return store_add_to_backend_with_multihash( + image_id, data, size, hashing_algo, store, context, verifier) + + def set_acls(location_uri, public=False, read_tenants=[], write_tenants=None, context=None): diff --git a/glance_store/multi_backend.py b/glance_store/multi_backend.py index fec5bf68..9f0e507b 100644 --- a/glance_store/multi_backend.py +++ b/glance_store/multi_backend.py @@ -279,6 +279,16 @@ def add(conf, image_id, data, size, backend, context=None, verifier) +def add_with_multihash(conf, image_id, data, size, backend, hashing_algo, + scheme=None, context=None, verifier=None): + if not backend: + backend = conf.glance_store.default_backend + + store = get_store_from_store_identifier(backend) + return store_add_to_backend_with_multihash( + image_id, data, size, hashing_algo, store, context, verifier) + + def _check_metadata(store, metadata): if not isinstance(metadata, dict): msg = (_("The storage driver %(driver)s returned invalid "