1095 Commits

Author SHA1 Message Date
Zuul
fe013f7417 Merge "trivial: Refactor os_options processing" 2023-03-24 18:02:57 +00:00
Tim Burke
825145e9e6 trivial: Refactor os_options processing
Change-Id: I01c096084172ea8ebeda791016a603c59c7924cd
2023-03-23 20:32:23 -07:00
Tim Burke
9c45343845 shell: Allow uploads from stdin to specify --use-dlo
Change-Id: Id6818ab416380242cc215a980a541fc59109c69c
2023-03-23 09:05:45 -07:00
Zuul
31c279ff0e Merge "Use SLO by default for segmented uploads if the cluster supports it" 2023-03-22 16:00:44 +00:00
Zuul
cd82d15506 Merge "docs: Fix code-generated docs" 2023-03-21 20:28:45 +00:00
Tim Burke
f96c3cff5c docs: Fix code-generated docs
Skip multithreading since some upstream docstrings have invalid ReST.

Change-Id: I682238b8307e5a2f9bd7607676749497cd6d4261
2023-03-21 13:07:04 -07:00
Tim Burke
6a8675e897 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
2023-03-21 12:46:44 -07:00
Zuul
62641a2f49 Merge "Retry on SSLError" 2023-03-21 19:37:06 +00:00
Tim Burke
9e703b9345 shell: Allow timeouts to have units
Related-Change: Ibbe7e5aa8aa8e54935da76109c2ea13fb83bc7ab
Change-Id: Ifeaaea790d1dadc84b157a7cf2be7590949c70f0
2023-03-20 17:23:38 -07:00
Tim Burke
099dd66265 Retry on SSLError
...provided it isn't something to do with certification validation.

Closes-Bug: #1641363
Closes-Bug: #2011731
Change-Id: Ic3acbf431e444fcd8bc0fe79571fe2db4140cf22
2023-03-20 16:57:15 -07:00
Zuul
779cf7484e Merge "Metadata updates" 2023-03-20 16:27:40 +00:00
Tim Burke
d368644bc6 Metadata updates
Include project_urls so PyPI gets more sidebar links.

Include long_description_content_type to quiet a twine warning.

Change-Id: Id3b90927ba24fd47efdbeeb2107bdae9e86e93ba
2023-03-17 16:47:34 -07:00
Tim Burke
e343298240 Include transaction ID on content-check failures
Change-Id: I6b667db26ffc5dccdcadfc8c73f7accb81f03dac
2023-03-15 12:37:02 -07:00
Zuul
d572ccfae9 Merge "service: Check content-length before etag" 2023-03-15 11:30:08 +00:00
Tim Burke
6adb8bb17f service: Check content-length before etag
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
2023-03-14 11:56:03 -07:00
Tim Burke
16f0034e67 Switch from pkg_resources to importlib
Seen on Arch Linux:

    ModuleNotFoundError: No module named 'pkg_resources'

On new enough Python, we don't need it anyway.

Change-Id: I3d46319a36a1c2477e9f7dae0c7e40a362a17639
2023-03-14 10:41:52 -07:00
Zuul
0f2b567953 Merge "Update master for stable/2023.1" 2023-03-08 01:28:04 +00:00
cf3be5210f Update master for stable/2023.1
Add file to the reno documentation build to show release notes for
stable/2023.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.1.

Sem-Ver: feature
Change-Id: I757174e91ffd514d97a76886ab728652ddba79e9
2023-03-06 12:07:00 -08:00
Tim Burke
ff6b359d06 Retry with fresh socket on 499
Change-Id: I0c22eefb587375997672724c03744c9cda473708
2023-02-15 21:01:07 -08:00
Zuul
7bd0951086 Merge "Back-fill a bunch of ChangeLog releases" 2023-01-25 23:16:58 +00:00
Zuul
d2a4a9d37d Merge "Switch to 2023.1 Python3 unit tests and generic template name" 2023-01-25 23:16:56 +00:00
Zuul
716cda9b56 Merge "Allow tempurl to be used to sign /info requests" 2023-01-25 23:13:43 +00:00
Tim Burke
6954ab1bbb Back-fill a bunch of ChangeLog releases
Change-Id: I3d89c3ff3d2789d64ba8f9c46fd1cd27c4c3a845
2023-01-06 12:05:14 -08:00
Tim Burke
20cee12be6 Add experimental jobs for py36/37
Change-Id: I6452aa6019d66da21dd512a6b4267a896d4893d4
2023-01-05 17:47:25 -08:00
Tim Burke
7a83087a52 Mark Python 3.10 testing as voting
Change-Id: I4743973e34ef1fcba9e5b64e32b2f1f458de75ba
2023-01-05 17:45:20 -08:00
Tim Burke
3264fd6cfd Drop *_proxy from passenv
For tox 3.x and earlier, passenv was a space-separated list; as of tox
4.0.0, it's comma-separated. For a while, our spaces would be silently
included in the now-one-and-only passenv value parsed (which wasn't
great, but mostly just caused confusion) -- as of tox 4.0.6, however, it
became a hard error, and all tests would fail like

  pass_env values cannot contain whitespace, use comma to have multiple
  values in a single line, invalid values found 'SWIFT_* *_proxy'

Unfortunately, we don't really know what versions of tox all our various
stakeholders might want/need to use (though we currently set a
minversion of 3.18.0), and (to my knowledge) there's no way to specify
multiple values for passenv in a way that would be compatible with both
old and new tox.

Fortunately, as of 3.14.4, tox include HTTP_PROXY, HTTPS_PROXY, and
NO_PROXY in passenv by default. I'm fairly certain those were the only
reason we had *_proxy to begin with, so just drop it.

Change-Id: I8ddfbc6376434c39e231846135a99bd0bdca9497
2023-01-05 16:58:36 -08:00
d9d6257e3b Switch to 2023.1 Python3 unit tests and generic template name
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for antelope. Also,
updating the template name to generic one.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: I4b8d75aab6b5d80756fbd83ffb62e5135365a685
2022-09-14 09:26:21 +00:00
7f4855dd1b Update master for stable/zed
Add file to the reno documentation build to show release notes for
stable/zed.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.

Sem-Ver: feature
Change-Id: Ibe6a46e97a8e08c2ec38ad1a3b80a1f63659a689
2022-09-10 23:06:44 +09:00
Tim Burke
f4e62191bc Allow tempurl to be used to sign /info requests
Change-Id: I1f9d26541e9c8f5aec7a6790c87df397d178efe6
2022-08-29 13:13:34 -07:00
Zuul
662e530d8d Merge "Allow tempurl times to have units" 4.1.0 2022-08-25 07:38:36 +00:00
Zuul
02509acc71 Merge "Add option to skip container PUT during upload" 2022-08-23 00:37:52 +00:00
Tim Burke
defbb4a8f3 Allow tempurl times to have units
Specifically, let users add a suffix for seconds, minutes, hours, or
days.

Change-Id: Ibbe7e5aa8aa8e54935da76109c2ea13fb83bc7ab
2022-08-19 17:40:10 -07:00
Zuul
249201f7ea Merge "Fix misuse of assertTrue" 2022-08-19 01:50:40 +00:00
Zuul
c1f5e8b7c1 Merge "Expand retry handling on ratelimit response" 2022-08-19 00:43:25 +00:00
Zuul
3b30f155a7 Merge "Enable retry_on_ratelimit by default" 2022-08-19 00:42:56 +00:00
Clay Gerrard
653cbcb686 Expand retry handling on ratelimit response
We have seen middlewares that return ratelimit responses as 498 or 429,
so tolerate either.

Closes-Bug: #1879572
Change-Id: I027222157f6c2ad7882a0508302c9de097baae4c
2022-08-18 12:14:04 -07:00
Tim Burke
a1d2f31131 Enable retry_on_ratelimit by default
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
2022-08-18 12:12:35 -07:00
Takashi Natsume
0bd2ab5cb0 Fix misuse of assertTrue
Replace assertTrue with assertEqual.

Change-Id: Ia3524bc5b3b01c0039bede6bb172535eb85bac08
Closes-Bug: 1986948
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-08-18 22:39:35 +09:00
Zuul
7f2649bfb7 Merge "More cleanup following py2 removal" 2022-08-18 01:49:01 +00:00
Tim Burke
9eee29d2e4 tempurl: Support sha256 and sha512 signatures
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
4.0.1
2022-06-08 09:30:21 -07:00
Takashi Kajinami
1dc635a32c doc: Comment out language option
... because explicit language=None causes the below warning since
Sphinx 5.0.0.

Invalid configuration value found: 'language = None'. Update your
configuration to a valid language code. Falling back to 'en' (English).

Change-Id: I842fd6c1eb5c0e14d85f8eec6078d735fbd506b8
2022-06-07 00:36:10 +09:00
Tim Burke
5d451fb920 More cleanup following py2 removal
* Drop py2-only hacking pin from test-requirements.

* Remove quote() helper; urllib.parse.quote() works fine.

* Remove some useless code.

Change-Id: I9ffc923f58f1d11538f83ff26f7beb53cdf134c3
2022-05-24 08:33:02 -07:00
Steve Kowalik
20c97e83d3 Remove use of mock
Since Python 3.4, the unittest module has provided mock, negating the
need for the external dependancy. Switch to using unittest.mock.

Change-Id: Idec3aaed2fddd1ece3ed86ee0bcc48f7616d56fa
2022-05-24 11:56:35 +10:00
Pavel Abalikhin
95f68cd673 Add timeout for Swift service
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
4.0.0
2022-04-21 18:00:27 +03:00
Stephen Finucane
20d837a276 Remove unnecessary unicode prefixes
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
2022-03-21 18:32:30 +00:00
Stephen Finucane
61ce5ac824 Remove unnecessary object subclassing
All classes subclass from object by default in Python 3.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I5a1ad57bcc092861ce969759b06a07c880ad3d35
2022-03-21 18:32:00 +00:00
Stephen Finucane
fa137a5bf1 Remove six
This mostly affects tests. Nothing too complicated

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Iabc78f651e1d48db35638280722f8019798eccd6
2022-03-21 18:31:10 +00:00
Stephen Finucane
4983b90983 Remove coding comments
Everything is unicode in Python 3.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I6a076dc67c461f265ed99878e3959e1992a88189
2022-03-21 18:29:25 +00:00
Stephen Finucane
3d10744c55 Remove __future__ imports
These aren't needed in modern Python 3 versions.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I5e81d6fb2e2cb8e4bfae4ed746da002f44e871c4
2022-03-21 18:29:25 +00:00
Aarni Koskela
c09621eb42 Don't patch Requests globally on import
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
2022-03-21 08:05:54 -07:00