diff --git a/conf/default.cfg b/conf/default.cfg index f649bce9..0f0e8ed9 100644 --- a/conf/default.cfg +++ b/conf/default.cfg @@ -76,9 +76,11 @@ use = egg:oioswift#main allow_account_management = true account_autocreate = true -# Manage if container should be created if nonexisting -# It must be true if hashedcontainer, regexcontainer, autocontainer or container_hierarchy middleware is used -sds_autocreate = true +# Enable or disable container autocreation. When disabled, trying to create +# an object in a container that does not exist will trigger an error. +# This parameter must be true if any of hashedcontainer, regexcontainer, +# autocontainer or container_hierarchy middleware is used. +#sds_autocreate = true [filter:hashedcontainer] use = egg:oioswift#hashedcontainer diff --git a/oioswift/proxy/controllers/obj.py b/oioswift/proxy/controllers/obj.py index df97656c..ed9b5611 100644 --- a/oioswift/proxy/controllers/obj.py +++ b/oioswift/proxy/controllers/obj.py @@ -498,6 +498,8 @@ def _store_object(self, req, data_source, headers): return HTTPUnprocessableEntity(request=req) except (exceptions.ServiceBusy, exceptions.OioTimeout): raise + # TODO(FVE): exceptions.NotFound is never raised from oio + # Remove when dependency is oio>=4.2.0 except (exceptions.NoSuchContainer, exceptions.NotFound): raise HTTPNotFound(request=req) except exceptions.ClientException as err: diff --git a/oioswift/server.py b/oioswift/server.py index 159d4889..6d9d2996 100644 --- a/oioswift/server.py +++ b/oioswift/server.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 OpenIO SAS +# Copyright (c) 2016-2018 OpenIO SAS # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -85,8 +85,8 @@ def __init__(self, conf, memcache=None, logger=None, account_ring=None, if 'autocreate' in sds_conf and not ( hasattr(ObjectStorageApi, 'EXTRA_KEYWORDS') or 'autocreate' in ObjectStorageApi.EXTRA_KEYWORDS): - logger.error('autocreate parameter is not available with current ' - 'OpenIO SDS') + logger.warn("'autocreate' parameter is ignored by current version" + " of OpenIO SDS. Please update to oio>=4.1.23.") else: sds_conf['autocreate'] = config_true_value( sds_conf.get('autocreate', 'true'))