diff options
author | Tim Burke <tim.burke@gmail.com> | 2022-11-14 13:17:47 -0800 |
---|---|---|
committer | Tim Burke <tim.burke@gmail.com> | 2023-03-21 12:46:44 -0700 |
commit | 6a8675e897e634abd26d993181ac4a45b9cf16f7 (patch) | |
tree | b7cedbcb8c87559f28ba472c6a0512585266feaa /swiftclient/shell.py | |
parent | 779cf7484e44855ddbf6f29d48af79104e42a0a6 (diff) | |
download | python-swiftclient-6a8675e897e634abd26d993181ac4a45b9cf16f7.tar.gz |
Use SLO by default for segmented uploads if the cluster supports it
We've had SLO for nearly ten years, and it is preferable for most
use-cases. It's time to default to SLO rather than DLO.
Add a new --use-dlo option to give users a way to return to old
behavior; ensure there is still a --use-slo option so we don't break
existing scripts that may use it.
UpgradeImpact:
==============
The default segmented-upload behavior has changed; Static Large Objects
are now used by default rather than Dynamic Large Objects. To revert to
the old behavior:
* CLI users may use the new `--use-dlo` option
* Service API users may explicitly set `use_slo` to False in their
options dicts
Change-Id: Iebcd64ced8eab6efebb9f02a0c4be6bf6338cb3b
Diffstat (limited to 'swiftclient/shell.py')
-rwxr-xr-x | swiftclient/shell.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py index 882a1c0..319141d 100755 --- a/swiftclient/shell.py +++ b/swiftclient/shell.py @@ -978,8 +978,8 @@ def st_copy(parser, args, output_manager, return_parser=False): st_upload_options = '''[--changed] [--skip-identical] [--segment-size <size>] [--segment-container <container>] [--leave-segments] [--object-threads <thread>] [--segment-threads <threads>] - [--meta <name:value>] [--header <header>] - [--use-slo] [--ignore-checksum] [--skip-container-put] + [--meta <name:value>] [--header <header>] [--use-slo] + [--use-dlo] [--ignore-checksum] [--skip-container-put] [--object-name <object-name>] <container> <file_or_directory> [<file_or_directory>] [...] ''' @@ -1024,8 +1024,11 @@ Optional arguments: repeated. Example: -H "content-type:text/plain" -H "Content-Length: 4000". --use-slo When used in conjunction with --segment-size it will - create a Static Large Object instead of the default - Dynamic Large Object. + create a Static Large Object. Deprecated; this is now + the default behavior when the cluster supports it. + --use-dlo When used in conjunction with --segment-size it will + create a Dynamic Large Object. May be useful with old + swift clusters. --ignore-checksum Turn off checksum validation for uploads. --skip-container-put Assume all necessary containers already exist; don't automatically try to create them. @@ -1087,10 +1090,13 @@ def st_upload(parser, args, output_manager, return_parser=False): ' This option may be repeated. Example: -H "content-type:text/plain" ' '-H "Content-Length: 4000"') parser.add_argument( - '--use-slo', action='store_true', default=False, + '--use-slo', action='store_true', default=None, help='When used in conjunction with --segment-size, it will ' - 'create a Static Large Object instead of the default ' - 'Dynamic Large Object.') + 'create a Static Large Object.') + parser.add_argument( + '--use-dlo', action='store_false', dest="use_slo", default=None, + help='When used in conjunction with --segment-size, it will ' + 'create a Dynamic Large Object.') parser.add_argument( '--object-name', dest='object_name', help='Upload file and name object to <object-name> or upload dir and ' |