Skip to content

Commit

Permalink
Allow acl_public = True/False to be in config file
Browse files Browse the repository at this point in the history
Normally acl_public = None and it's not present, nor read from,
the config file.  If a user wants to set it in the config file though,
we need to be able to read it from the config file.

We also need to _not_ have the lack of command line options
unintentionally set it back to None.

Add special handling for acl_public, when reading in the
config file, and when handling --acl-public and --acl-private options.
  • Loading branch information
mdomsch committed Dec 11, 2015
1 parent 84168b2 commit bc38c2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions S3/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ def read_config_file(self, configfile):
_option = _option.strip()
self.update_option(option, _option)

# allow acl_public to be set from the config file too, even though by
# default it is set to None, and not present in the config file.
if cp.get('acl_public'):
self.update_option('acl_public', cp.get('acl_public'))

if cp.get('add_headers'):
for option in cp.get('add_headers').split(","):
(key, value) = option.split(':')
Expand Down
3 changes: 2 additions & 1 deletion s3cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2726,7 +2726,8 @@ def main():

## Special handling for tri-state options (True, False, None)
cfg.update_option("enable", options.enable)
cfg.update_option("acl_public", options.acl_public)
if options.acl_public is not None:
cfg.update_option("acl_public", options.acl_public)

## Check multipart chunk constraints
if cfg.multipart_chunk_size_mb < MultiPartUpload.MIN_CHUNK_SIZE_MB:
Expand Down

0 comments on commit bc38c2a

Please sign in to comment.