Skip to content

Commit

Permalink
Document 'sds_autocreate' parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
fvennetier committed May 9, 2018
1 parent 434be2b commit f3a3e02
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions conf/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions oioswift/proxy/controllers/obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions oioswift/server.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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'))
Expand Down

0 comments on commit f3a3e02

Please sign in to comment.