summaryrefslogtreecommitdiff
path: root/swiftclient
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Ensure v*password auth_type correctly implies auth version"Zuul2023-03-241-5/+14
|\
| * Ensure v*password auth_type correctly implies auth versionTim Burke2023-03-231-5/+14
| | | | | | | | Change-Id: I787b0988b7518850f1e1f93ca269f39f8cdec15c
* | Merge "trivial: Refactor os_options processing"Zuul2023-03-241-19/+20
|\ \ | |/
| * trivial: Refactor os_options processingTim Burke2023-03-231-19/+20
| | | | | | | | Change-Id: I01c096084172ea8ebeda791016a603c59c7924cd
* | shell: Allow uploads from stdin to specify --use-dloTim Burke2023-03-231-1/+1
|/ | | | Change-Id: Id6818ab416380242cc215a980a541fc59109c69c
* Merge "Use SLO by default for segmented uploads if the cluster supports it"Zuul2023-03-222-9/+27
|\
| * Use SLO by default for segmented uploads if the cluster supports itTim Burke2023-03-212-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Retry on SSLError"Zuul2023-03-211-2/+7
|\ \
| * | Retry on SSLErrorTim Burke2023-03-201-2/+7
| |/ | | | | | | | | | | | | | | ...provided it isn't something to do with certification validation. Closes-Bug: #1641363 Closes-Bug: #2011731 Change-Id: Ic3acbf431e444fcd8bc0fe79571fe2db4140cf22
* | shell: Allow timeouts to have unitsTim Burke2023-03-202-2/+16
|/ | | | | Related-Change: Ibbe7e5aa8aa8e54935da76109c2ea13fb83bc7ab Change-Id: Ifeaaea790d1dadc84b157a7cf2be7590949c70f0
* Include transaction ID on content-check failuresTim Burke2023-03-151-7/+13
| | | | Change-Id: I6b667db26ffc5dccdcadfc8c73f7accb81f03dac
* Merge "service: Check content-length before etag"Zuul2023-03-151-7/+7
|\
| * service: Check content-length before etagTim Burke2023-03-141-7/+7
| | | | | | | | | | | | | | | | If the received content-length does not match expectations, of course the etag won't match! Co-Authored-By: Alistair Coles <alistairncoles@gmail.com> Change-Id: I1a0c066c11b94718fffbb11e13b82d0b16e01626
* | Switch from pkg_resources to importlibTim Burke2023-03-141-8/+22
|/ | | | | | | | | | Seen on Arch Linux: ModuleNotFoundError: No module named 'pkg_resources' On new enough Python, we don't need it anyway. Change-Id: I3d46319a36a1c2477e9f7dae0c7e40a362a17639
* Retry with fresh socket on 499Tim Burke2023-02-151-1/+3
| | | | Change-Id: I0c22eefb587375997672724c03744c9cda473708
* Allow tempurl to be used to sign /info requestsTim Burke2022-08-291-3/+11
| | | | Change-Id: I1f9d26541e9c8f5aec7a6790c87df397d178efe6
* Merge "Allow tempurl times to have units"4.1.0Zuul2022-08-252-42/+65
|\
| * Allow tempurl times to have unitsTim Burke2022-08-192-42/+65
| | | | | | | | | | | | | | Specifically, let users add a suffix for seconds, minutes, hours, or days. Change-Id: Ibbe7e5aa8aa8e54935da76109c2ea13fb83bc7ab
* | Merge "Add option to skip container PUT during upload"Zuul2022-08-232-48/+60
|\ \
| * | Add option to skip container PUT during uploadTim Burke2022-01-112-48/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a user with read/write access to a container (but without access to creat new containers) recieves a warning every time they upload. Now, allow them to avoid the extra request and warning by specifying --skip-container-put on the command line. This is also useful when testing: developers can HEAD a container to ensure it's in memcache, shut down all container servers, then upload and creaate a bunch of async pendings. Previously, the 503 on container PUT would prevent the object upload from even being attempted. Closes-Bug: 1317956 Related-Bug: 1204558 Change-Id: I3d9129a0b6b65c6c6187ae6af003b221afceef47 Related-Change: If1f8a02ee7459ea2158ffa6e958f67d299ec529e
* | | Merge "Expand retry handling on ratelimit response"Zuul2022-08-191-1/+1
|\ \ \
| * | | Expand retry handling on ratelimit responseClay Gerrard2022-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have seen middlewares that return ratelimit responses as 498 or 429, so tolerate either. Closes-Bug: #1879572 Change-Id: I027222157f6c2ad7882a0508302c9de097baae4c
* | | | Merge "Enable retry_on_ratelimit by default"Zuul2022-08-192-4/+7
|\ \ \ \ | |/ / / | | | / | |_|/ |/| |
| * | Enable retry_on_ratelimit by defaultTim Burke2022-08-182-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UpgradeImpact ============= The Connection class now enables retry_on_ratelimit by default. If you need to return to the old behavior, explicitly pass retry_on_ratelimit=False as a keyword arg. The SwiftService class will now enables the retry_on_ratelimit option by default. If you need to return to the old behavior, explicitly set it to false in your options dict. Change-Id: I3221fda84f0b8031c50128aa600e2c19deb5b102
* | | Merge "More cleanup following py2 removal"Zuul2022-08-183-16/+1
|\ \ \ | |/ / |/| |
| * | More cleanup following py2 removalTim Burke2022-05-243-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Drop py2-only hacking pin from test-requirements. * Remove quote() helper; urllib.parse.quote() works fine. * Remove some useless code. Change-Id: I9ffc923f58f1d11538f83ff26f7beb53cdf134c3
* | | tempurl: Support sha256 and sha512 signatures4.0.1Tim Burke2022-06-082-4/+29
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up the default to sha256 since * the proxy has supported (and defaulted to allowing) it for four years now, and * Rackspace has supported it for even longer. Include a note in the --help about older clusters likely requiring sha1. Change-Id: Ibac2bb7e2e4c9946c7384f0aab8e43d0d79ba645 Related-Change: Ia9dd1a91cc3c9c946f5f029cdefc9e66bcf01046 Related-Bug: #1733634 Closes-Bug: #1977867
* | Add timeout for Swift service4.0.0Pavel Abalikhin2022-04-212-0/+4
| | | | | | | | | | | | | | Connection class has timeout parameter but SwiftService and shell don't use it. That can lead to an endless wait when network is unreachable. Change-Id: Iafa42fc2f8b56feefa2bc8ea6a1b8845717d3bab
* | Remove unnecessary unicode prefixesStephen Finucane2022-03-211-4/+4
| | | | | | | | | | | | | | | | All strings are unicode by default in Python 3. No need to mark them as such. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: I68fb60ef271abfddebcc9d2137424f5db2a17e92
* | Remove unnecessary object subclassingStephen Finucane2022-03-215-16/+16
| | | | | | | | | | | | | | All classes subclass from object by default in Python 3. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: I5a1ad57bcc092861ce969759b06a07c880ad3d35
* | Remove sixStephen Finucane2022-03-217-86/+53
| | | | | | | | | | | | | | This mostly affects tests. Nothing too complicated Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: Iabc78f651e1d48db35638280722f8019798eccd6
* | Remove coding commentsStephen Finucane2022-03-211-1/+0
| | | | | | | | | | | | | | Everything is unicode in Python 3. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: I6a076dc67c461f265ed99878e3959e1992a88189
* | Remove __future__ importsStephen Finucane2022-03-213-6/+1
| | | | | | | | | | | | | | These aren't needed in modern Python 3 versions. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: I5e81d6fb2e2cb8e4bfae4ed746da002f44e871c4
* | Don't patch Requests globally on importAarni Koskela2022-03-212-22/+59
| | | | | | | | | | | | | | | | | | | | This also upgrades the Requests dependency to 2.4+ (released in 2014) to avoid having to do version comparisons altogether. Refs https://bugs.launchpad.net/python-swiftclient/+bug/1904551 Signed-off-by: Aarni Koskela <akx@iki.fi> Change-Id: I58399f6c526b0b78462f31739c43076314ba9e76
* | Drop support for Python 2Stephen Finucane2022-03-161-16/+2
|/ | | | | | | There's a lot of cleanup possible, but this is a start. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: Ia1176b7fd5434d52070d482a37abfbb98800cdb3
* Merge "Include storage policy when listing account with --long"3.13.0Zuul2021-10-131-2/+3
|\
| * Include storage policy when listing account with --longTim Burke2021-09-211-2/+3
| | | | | | | | Change-Id: Ibc2f9445b5a8e80cfb73d0706e20a7e4c62eec4a
* | Correctly aggregate totals for >10k itemsTim Burke2021-09-211-15/+17
|/ | | | | | | | | | | | | | | | | Previously, we would write out totals for every page of listings, like $ swift list sync --prefix=09-21 --total -l 80000000000 80000000000 80000000000 58096000000 Now, roll those all into a single total: $ swift list sync --prefix=09-21 --total -l 298096000000 Change-Id: Icc265636815220e33e8c9eec0a3ab80e9f899038
* Only log the traceback for non-404sTim Burke2021-09-201-1/+1
| | | | Change-Id: I08ba4a3120e99b444b13f1ca6f5493529868df26
* Improve formatting for billions of objectsTim Burke2021-09-201-2/+2
| | | | Change-Id: If8aa08c4c8c8ad6ca2c861602baf1eefa8642a8a
* Fix Typo in shell.pyjonasdlindner2021-04-291-1/+1
| | | | Change-Id: I2615e0d6b54d8cc020c24d1b5b4064e038f0934b
* Have `delete --all` imply `--versions` for the CLITim Burke2020-10-161-2/+4
| | | | Change-Id: Id5a6d4cef3d4ed76c897a099a62a4ba3ed8f8dab
* Merge "Close connections created when calling module-level functions"Zuul2020-10-151-17/+70
|\
| * Close connections created when calling module-level functionsTim Burke2020-10-131-17/+70
| | | | | | | | | | | | | | | | Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com> Change-Id: Id62e63afc6f2ffa32eb8640787c78559481050f9 Related-Change: I200ad0cdc8b7999c3f5521b9a822122bd18714bf Related-Bug: #1873435 Closes-Bug: #1838775
* | Merge "Include transaction ID in ClientException.__str__"Zuul2020-09-222-2/+13
|\ \ | |/ |/|
| * Include transaction ID in ClientException.__str__Tim Burke2020-09-092-2/+13
| | | | | | | | | | | | | | | | | | | | It's fairly annoying getting a traceback in swift's probe tests then only having a URL and status code to go searching for in logs. Leave the shell.py output untouched, though, since we output the transaction ID on a new line anyway. Change-Id: Idb849848ec08b6c04812b088467c9a687c2a7e27
* | (Mostly) revert "Cleanup session on delete"Tim Burke2020-09-081-8/+10
|/ | | | | | | | | | This reverts commit 1f26c5736949e1c3b57c024a315e33fc419f126e for py2. Apparently the existence of the __del__ method on Python 2 prevents us from cleaning up all file descriptors. Change-Id: Id6cff5dd7b9faf9c4240c0cb26b74d05ed37da5b Closes-Bug: #1873435 Related-Bug: #1838775
* Add max_backoff and starting_backoff for get_conn in swift serviceMeuh2020-07-281-2/+4
| | | | Change-Id: I45f5d3009e0e2015c7366384ee826113fc27c70b
* Clean up some warningsTim Burke2020-06-171-2/+5
| | | | Change-Id: Iae149533d04c7b173c4ef88fb775f5fe13c16466
* Application credential support follow-upTim Burke2020-05-272-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the recent v3applicationcredentials patch, if you have your environment variables set up to work with python-openstackclient using swiftclient's v1password plugin, swiftclient won't work: $ env | egrep '^(OS|ST)_' ST_KEY=testing ST_USER=test:tester OS_AUTH_URL=http://saio/auth/v1.0 ST_AUTH=http://saio/auth/v1.0 OS_USERNAME=test:tester OS_AUTH_TYPE=v1password OS_PASSWORD=testing $ openstack object store account show +------------+----------------------------+ | Field | Value | +------------+----------------------------+ | Account | AUTH_test | | Bytes | 0 | | Containers | 11 | | Objects | 0 | +------------+----------------------------+ $ swift stat Only "v3applicationcredential" is supported for --os-auth-type We don't really want to allow (and mostly ignore) arbitrary OS_AUTH_TYPE values, though -- there are a whole bunch of plugins we don't remotely support. But it seems OK to allow any of the password plugins; while we won't actually use them (currently), we provide roughly equivalent functionality. Handful of other drive-bys: * Use a None sentinel to determine whether keystoneauth1 is installed instead of trying to catch a NameError. * Clarify error state when keystoneauth1 is not installed. * Fix a typo: "sses" -> "sess". Change-Id: Id7ea9c3ea8278ae86a04d057a472a8f8a87b8eae Related-Change: I9190e5e7e24b6a741970fa0d0ac792deccf73d25