Skip to content

Commit bc38c2a

Browse files
committed
Allow acl_public = True/False to be in config file
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.
1 parent 84168b2 commit bc38c2a

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

S3/Config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ def read_config_file(self, configfile):
253253
_option = _option.strip()
254254
self.update_option(option, _option)
255255

256+
# allow acl_public to be set from the config file too, even though by
257+
# default it is set to None, and not present in the config file.
258+
if cp.get('acl_public'):
259+
self.update_option('acl_public', cp.get('acl_public'))
260+
256261
if cp.get('add_headers'):
257262
for option in cp.get('add_headers').split(","):
258263
(key, value) = option.split(':')

s3cmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2726,7 +2726,8 @@ def main():
27262726

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

27312732
## Check multipart chunk constraints
27322733
if cfg.multipart_chunk_size_mb < MultiPartUpload.MIN_CHUNK_SIZE_MB:

0 commit comments

Comments
 (0)