Commit Graph

960 Commits

Author SHA1 Message Date
Takashi Kajinami c34fc8ae5d Bump hacking
hacking 3.0.x is too old.

Change-Id: I24423a1524de2744c5bb96a0bd7b23d5592c97a0
2024-01-17 02:08:23 +09:00
Zuul 167b07208d Merge "Fix osc sd create command" 2024-01-08 07:44:59 +00:00
Zuul cf563b6359 Merge "Make tests pass after 2038" 2024-01-08 07:32:34 +00:00
Zuul 36c5b9c4c9 Merge "remove unicode prefix from code (2)" 2023-12-19 14:05:56 +00:00
Zuul e5c4dea5eb Merge "Remove leftover of Python <= 2.6 support" 2023-09-05 13:16:45 +00:00
Bernhard M. Wiedemann e7f7f1c3bd Make tests pass after 2038
time.time is used to not just shift the exiry time further into the future.

This bug was found while working on reproducible builds for openSUSE.

Change-Id: I146be9afa3ef54288218daa7ae21f7a7cb5aab67
2022-09-12 08:47:45 +02:00
Pavlo Shchelokovskyy 9bb529c62d Fix osc sd create command
the os_no_auth arg is only available in heat CLI, not openstack one.

Change-Id: Idf0c83304204e98909b8c876861b8ef9b0974f47
Story: 2010282
Task: 46253
2022-09-09 17:53:30 +03:00
Takashi Kajinami d9a4c29a4f remove unicode prefix from code (2)
In Python 3, unicode prefix is meaningless. This removes unicode prefix
from code implementation and unit tests.

Change-Id: Ic4534dfb3fb6a2d8f7fcf4859a0eacbc3bd146e4
2022-08-07 02:14:56 +09:00
Takashi Kajinami 69d4a5ee93 Accept sha256 hash for swift tempurl
Since swiftclient 4.0.1, sha256 is used when generating tempurl
signature[1].
This change extends the regex pattern to assert signatues so that it
can accept both sha1(old) and sha256(current).

[1] https://review.opendev.org/c/openstack/python-swiftclient/+/845157

Change-Id: I1589adbe4501b1c678f197b9c0f67b716c341b2d
2022-07-18 05:38:23 +00:00
Takashi Kajinami d2bc013a89 Remove leftover of Python <= 2.6 support
Change-Id: I7de3cd0dfef8d7aeb0c9ad3e8cc167c1a40cb65d
2022-07-17 00:38:46 +09:00
Zuul 9e84a5970b Merge "Remove six" 2022-06-13 17:51:28 +00:00
Pavlo Shchelokovskyy 66adfe14a6 Encode urls in unit tests
currently several unit tests are failing when path from where
they run contains url-quotable characters like '@', which apparently is
possile in e.g. Jenkins.

Change-Id: I44eab3f4a384a27f34e4066651baafa6a9489f49
2022-06-13 18:56:45 +03:00
Takashi Kajinami 23e647539c Remove six
This library no longer supports Python 2, thus usage of six can be
removed.

Change-Id: I8d0c1cfd6dff375b3b7756a5b36c95a2df3f04c6
2022-05-09 17:01:25 +00:00
Takashi Kajinami 796a8f5a96 Replace deprecated import of ABCs from collections
ABCs in collections should be imported from collections.abc and direct
import from collections is deprecated since Python 3.3.

Closes-Bug: #1936667
Change-Id: Ie312cb884537ec541bf2111fe8a647e939b6519e
2021-12-16 07:21:36 +00:00
rabi 4753a47bbf Fix test and lower constraints
This fixes failures for PyYAML new version and
lower constraints.

Change-Id: Iba863242365c4be63495600b741513c2ca0ea9b0
2021-12-16 09:56:18 +05:30
Takashi Kajinami b4383147fe Replace oslo_utils.fnmatch with fnmatch
The oslo_utils.fnmatch module was added to solve an issue in py2.7 but
it is no longer required because py2.7 is no longer supported.
The module was deprecated since oslo.utils 4.9.1[1] and the stdlib's
fnmatch module should be used instead.

[1] 4c893c92f551c9dd2a7cfbe7ae8171ad8139df0b

Change-Id: I95535adeb45363500b3ed9729bb61cb4308d23b9
2021-07-06 21:24:33 +09:00
Zuul b2a601c7e8 Merge "Stop to use the __future__ module." 2020-11-16 08:37:26 +00:00
Thomas Goirand 2b6f6ac284 Python 3.9: base64.encodestring is removed
We should use base64.encodebytes instead, which is avaiable since
Python 3.2.

Change-Id: Ic945aff08d00bf2e602964cb1e25ea045e645b17
2020-10-16 13:09:42 +02:00
Ghanshyam Mann 17958681f6 [goal] Migrate testing to ubuntu focal
As per victoria cycle testing runtime and community goal[1]
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

Fixing:
- bug#1886298
Bump the lower constraints for required deps which added python3.8
support in their later version.

- noqa for pep8 C901 check.

Closes-Bug: #1886298

Story: #2007865
Task: #40186

[1] https://governance.openstack.org/tc/goals/selected/victoria/migrate-ci-cd-jobs-to-ubuntu-focal

Change-Id: I67b4957cea1ccbd5cdc0314d2eaddef0c24f7dfc
2020-09-06 00:50:35 +00:00
Luigi Toscano bb22add60c Native Zuul v3 version of the functional legacy job
Pretty straightforward conversion, and remove the old scripts
which are not needed anymore.

Also, even though OS_TENANT_NAME is still exported,
read OS_PROJECT_NAME as first choice.

Depends-On: https://review.opendev.org/746235
Change-Id: I51314da6d6bf0467308f3598fa9e666655e286d0
2020-08-19 12:22:38 +02:00
Hervé Beraud 4408269ae3 Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: Ifbca4f0b72663e026a92061c213e728cf755772c
2020-06-02 20:48:10 +02:00
jacky06 8a9566864f Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I5cf252c1a22977d3c87898e723e5001cc87a0d87
2020-05-06 05:43:23 +00:00
Andreas Jaeger 9dede4eb2b Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Change-Id: I82c745f5b1236844deec4538be84037a64eebeee
2020-03-31 10:04:12 +00:00
Zuul 6b071d397e Merge "Add files-container option for stack create and update" 2020-02-21 07:54:54 +00:00
Zuul 866e90374e Merge "Allow to set poll interval to OSC stack create" 2020-02-21 07:52:00 +00:00
Zuul 207968f353 Merge "Cleanup of .keys() from dict_object.keys() *in* operator" 2020-02-21 07:45:07 +00:00
Zane Bitter 869f3a943b Remove dependency on mox3
Change-Id: Ie6017be8293b36d1aedfb5cce7b76c85a8b95b63
2020-02-10 12:37:49 -05:00
Zane Bitter 163d4aa0e9 Remove mox usage from test_shell
Change-Id: I4e1dbb55dbc01ebf18ca80aa63ae492a1a8f47ae
2020-02-10 12:35:22 -05:00
Stephen Finucane 48d19397a6 tests: Convert 'test_resources' to mock
This is the smaller of the two.

Change-Id: I2a483698209e7c4ba2da074ffd7b9466f17937e2
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-01-30 15:19:55 +00:00
Stephen Finucane 75ed1cedd9 tests: Pre-mox removal cleanup
Move some stuff around in order to make the later migration easier to
parse.

Change-Id: I1404a5b23fd1852be9d04661c2a0ba12c4bb78ec
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-01-30 10:59:39 +00:00
jacky06 fcc7befd0f Cleanup of .keys() from dict_object.keys() *in* operator
Change-Id: I49bb58e5dc2618ee02424315e4e3bf1057a77068
2019-12-05 11:05:53 +08:00
Pavlo Shchelokovskyy 033511c291 Allow to set poll interval to OSC stack create
In certain scenarios the default poll interval of 5s used by
`openstack stack create --wait` command is too short.

Setting the poll interval was supported in heat CLI with
`heat stack-create --poll N` but is missing in OSC plugin.

This patch adds an optional argument `--poll N` (N defaults to 5) to the
`openstack stack create` command.

Change-Id: Id279d92ea890032f280e453b795ede2818ffbb8c
Story: 2004863
Task: 29106
2019-09-25 08:57:33 +00:00
Zuul 4d8f270157 Merge "Ignore not found when delete in test" 2019-09-05 05:04:46 +00:00
Zuul eca1637656 Merge "Update stack_id clearify for heat client functions" 2019-08-05 16:16:26 +00:00
ricolin 82c842f3d9 Update stack_id clearify for heat client functions
most of our client major function require stack_id. We should
provide more specific information (at lest in function description)
to clearify that it's allowed to feed in stack name to `stack_id`
too. For example, both `heat.stacks.get($Stack_UUID)` and
`heat.stacks.get($Stack_Name)` works.

Change-Id: I4428097140e0391a77679f5c69e00966f249efd7
2019-08-03 00:42:19 +08:00
Zane Bitter d87aa032de Fix unit tests
Change-Id: I44bbafa95d6eeb3550aac5b480391a3fc7ddaef5
2019-06-24 20:29:06 -04:00
zhufl 036ae75689 Fix missing print format
This is to:
1. Add missing print format for "%(hook_type)".
2. Add ws between words in log message "notavailable".

Change-Id: Iaee8697c95f66bff0536db9a266158a3cbc89412
2019-05-21 15:03:08 +08:00
Rabi Mishra bd33e310e0 Set Content-Type header explictly for SessionClient
SessionClient is subclassed from keystoneauth LegacyJsonAdapter.
LegacyJsonAdapter does not set the Content-Type explicitly
and results in decodeing issues in some cases.

Change-Id: Idf23022b394607c332490331fc4b216de6ff1313
Story: 2005237
Task: 30027
2019-03-15 05:08:51 +00:00
ricolin 3b74f2ddd1 Ignore not found when delete in test
Ignore not found when delete stack or stack snapshot in tests.
Story: #1737100
Task: #19354

Change-Id: I6c980b68023b33dc318c5d9506c2cac5866c4924
2019-02-03 05:16:08 +00:00
Zuul 9084feb640 Merge "Set X-Region-Name in header when using SessionClient" 2018-12-19 03:34:09 +00:00
Zuul 7877475961 Merge "Replace deprecated "decodestring()" by "decodebytes()"" 2018-11-28 19:37:38 +00:00
Zuul dd5f64c4c4 Merge "Load files from adopt file when adopt stack" 2018-11-20 20:08:28 +00:00
Vu Cong Tuan 02d0090c47 Replace deprecated "decodestring()" by "decodebytes()"
decodestring() is deprecated alias of decodebytes()
https://docs.python.org/3/library/base64.html#base64.decodestring

The same has been done for nova:
https://review.openstack.org/#/c/610401/

Change-Id: Ie069aaaff1646a70f3717fc6f9c7252949c4e5fd
2018-11-02 16:27:47 +07:00
rabi ae21e6b70d Set X-Region-Name in header when using SessionClient
We don't seem to set the header for region name when using session
client. It's used to look for service endpoints in the catalog.

Change-Id: I10cfdfb88b3f09e4ceb69b1020e82c4eba733804
Story: #2003806
Task: 26550
2018-09-19 12:21:01 +05:30
Mehdi Abaakouk 6ef3e8761e Don't change pyyaml behavior
When an application load heatclient, the default pyyaml behavior change.

This ensures only heatclient use it's custom pyyaml stuffs.

This currently breaks the telemetry gate if the tempest heat plugin is
loaded with the telemetry.

Change-Id: I5d7d1a1999e762f2285a0effc081252570f24de8
2018-09-04 10:33:39 +02:00
rabi bd2bfaa514 Add files-container option for stack create and update
If files-container option is specified:

- All template/env files would be fetched by the heat engine
  relative to the files_container and no local files other
  than the root template would be sent to server.
- Relative path of environment files would be sent in the
  environment_files list.

Also adds the option to template validate.

Change-Id: I1a703ab8798a003365be650886bb78be5af472b7
Story: #1755453
Task: 19319
2018-08-29 18:32:03 +05:30
Zuul c7b8212a63 Merge "Enable some off-by-default checks" 2018-07-20 19:32:24 +00:00
ricolin 597e98fec0 Load files from adopt file when adopt stack
Add files from adopt file into create fields. This allow us to
adopt nested stack which the template defined in files.
Story: #1700744
Task: #17263

Change-Id: I2b473791186949d49be59ee790185b3e394c7000
2018-07-20 15:34:04 +00:00
Zuul 4d15e574f9 Merge "Add heat CLI test for stack-show" 2018-07-13 05:44:08 +00:00
Zuul 6ddca4e3c3 Merge "Fix log_http_request function in http module" 2018-07-05 05:45:19 +00:00