Commit Graph

4176 Commits

Author SHA1 Message Date
Zuul d9b95d776a Merge "Fix tests on Python 3.12" 2024-05-21 07:41:51 +00:00
Zuul 525fabe051 Merge "Drop direct dependency on simplejson" 2024-05-20 11:45:21 +00:00
Takashi Kajinami cf6dd62dd1 Drop direct dependency on simplejson
The simplejson library is not included by the requirements but it was
directly imported. Drop the direct inclusion and use the alias in
the requests library to avoid ImportError caused by missing simplejson
in the environment.

Also fix the missing requests library in requirements.

Change-Id: I8713f45c5f2717cc53ba043aaeb479e72f641f78
2024-05-20 09:59:32 +09:00
Rajat Dhasmana 00af14b3f2 Add DeleteVolume class to v3
This is done to support the volume unmanage command.

Change-Id: Ib59b1f599be152a25c4b6a31988c28079f552ba9
2024-05-15 11:55:50 +05:30
Rajat Dhasmana cc7773f53b Add support for managing volumes
This patch adds support for the cinder manage command to
bring a volume under OpenStack management.

Change-Id: I12b63bfc4f0c9bc29cf9d4efd9a5cd038ec00af3
2024-05-15 11:53:27 +05:30
Rajat Dhasmana 0d9ace6425 Add CreateVolume class to v3
This patch acts as a base framework to add the parameters needed
for manage volume support.
This includes 2 changes:
1. Move get_parser and take_action code to common methods which
can be utilized by both v2 and v3
2. Make _check_size_arg as a static method and move it inside
CreateVolume class since it's not used by other classes.

[2] was initially thought to be a follow up change but since we
are implementing changes into the _check_size_arg method for v3,
it makes sense to just include it in CreateVolume class to avoid
adding a new additional method. Similar changes are done for v2
as well.

Change-Id: I9315e457ebd6c5ba4cc67452f92c9dc8c139ee3c
2024-05-15 11:46:12 +05:30
Stephen Finucane 4c31284936 Fix tests on Python 3.12
We were seeing the following test failures on Python 3.12:

  openstackclient.tests.unit.common.test_module.TestModuleList.test_module_list_all
  openstackclient.tests.unit.common.test_module.TestModuleList.test_module_list_no_options

Both failures were caused by missing attributes of 'sys', e.g.

  AttributeError: module 'sys' has no attribute 'builtin_module_names'

Fix this by exposing the real 'sys' module as part of our mock of
'sys.modules'.

Change-Id: I17391a46f08896f49dccaf75ad685dab1375a03d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-05-10 11:16:56 +01:00
Zuul 5e5b89f906 Merge "Router flavor_id can be a name" 2024-05-08 19:43:44 +00:00
Zuul 1ea291167b Merge "Improve output of 'server migrate --wait'" 2024-05-07 14:52:05 +00:00
Stephen Finucane 50c595b6e0 identity: Make better use of argparse
Change-Id: I50d2d28422e609656408b9b59f330d6a78314344
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-05-07 11:20:02 +01:00
elajkat 2e7ba5e3dd Router flavor_id can be a name
Change-Id: I72fc21a1adb4790a2a51e9b37744ee1ee3d01f32
Partial-Bug: #2020823
2024-05-06 13:36:04 +02:00
Zuul 3950b4f7ce Merge "tests: Fix trivial sorting issue" 2024-04-26 13:08:00 +00:00
Stephen Finucane 837a3dc015 tests: Fix trivial sorting issue
We've seen an ordering issue pop up occasionally in the CI. Resolve it.

Change-Id: I4dd10268b673c260ac0894fac92cd8bea9e626f4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-25 10:34:36 +01:00
Stephen Finucane c5b772db76 trivial: Prepare for pyupgrade pre-commit hook
This change is entirely automated save for the update of some mocks from
'io.open' to '__builtins__.open').

We are keeping this change separate from addition of the actual hook so
that we can ignore the commit later.

Change-Id: I0a9d8736632084473b57b57b693322447d7be519
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-23 12:24:23 +01:00
Zuul 3de6969dbe Merge "tox: Remove bandit skips, run via pre-commit" 2024-05-03 17:36:21 +00:00
Stephen Finucane 0646f9b4e4 tox: Remove bandit skips, run via pre-commit
Most of these skips were unnecessary. The few that did generate warnings
could be skipped.

We also set 'skip_install' since there's no reason to build the package
for linting purposes.

Change-Id: I9644e5c19720b9c41c60e0a5882b7cd7f6a71f7b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-26 13:17:15 +01:00
Stephen Finucane ee23995004 pre-commit: Bump versions
We fold in the new black changes also.

Change-Id: I326a0529b6b9f2aa9fbc33862567131839460797
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-23 12:22:26 +01:00
Bence Romsics bbe686109d
Improve output of 'server migrate --wait'
We have seen users interpret the current output ('Complete') of
'server migrate --wait' as if it meant success as well and be surprised
when later they learned that the migration was complete and failed.

This change adds a pointer to the that output, how to actually check the
success/failure of a migration, hoping to eliminate this user confusion.

Change-Id: I09030705a39405366d6202a5ac743cc4d1ddd63c
2024-04-16 10:58:42 +02:00
Zuul a79cb608b0 Merge "Add image metadef resource type association commands 'create', 'list', 'delete'" 2024-04-15 14:01:02 +00:00
Zuul 147503f3c6 Merge "Add NUMA affinity policy options "socket"" 2024-04-15 13:00:49 +00:00
Zuul 4d30527659 Merge "Add support for showing requested az in output" 2024-04-15 13:00:47 +00:00
Zuul c13977fd68 Merge "image cache clear: fix value of default target" 2024-04-15 13:00:43 +00:00
Zuul 7e3664ff07 Merge "Adds CLI support for ``glance md-object-property-show``" 2024-04-15 13:00:41 +00:00
Zuul 54bb7477f2 Merge "Do not sort subnet dns_nameservers field" 2024-04-15 13:00:39 +00:00
Zuul e9aa6f57c5 Merge "Identity: Properly list users in a group in 'user list' commands" 2024-04-15 13:00:37 +00:00
Antonia Gaete 276dbb6f56 Add image metadef resource type association commands
'create', 'list', 'delete'

Change-Id: I2c860427b0b2693076cfe57841f0e512ad1f6388
2024-04-15 11:42:45 +00:00
Zuul 9db8902c2b Merge "tests: Remove use of unnecessary fake argparse Namespace" 2024-04-12 17:28:37 +00:00
Zuul 9ca9eba624 Merge "tests: Use consistent shortcut to fake identity client" 2024-04-12 17:09:15 +00:00
Zuul 34ae192332 Merge "refectoring: remove duplicate declaration" 2024-04-12 01:55:18 +00:00
Stephen Finucane bb6b1e38cb tests: Remove use of unnecessary fake argparse Namespace
Change-Id: I135c24d0f6450d5af4e1860218bf3a65c09e36cc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-11 11:23:20 +01:00
Stephen Finucane ea202fe77c tests: Use consistent shortcut to fake identity client
Change-Id: I72e016b8146e38948b6ae857bf7ec0b18f4e3663
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-11 11:23:16 +01:00
ArtofBugs 948b97d09e Identity: Properly list users in a group in 'user list' commands
Change-Id: Ia4457eaea5016b2e0325c6eb704d1592058e455e
2024-04-09 12:15:00 -07:00
Zuul 57c73101a2 Merge "refectory: remove unreachable code" 2024-04-09 18:38:16 +00:00
Zuul 9467b404c7 Merge "volume: Deprecate '--retype-policy' in favor of '--migration-policy'" 2024-04-08 12:36:54 +00:00
Zuul 1a38af53eb Merge "volume list: Don't call nova if no volume is attached" 2024-04-08 11:40:41 +00:00
Rajat Dhasmana 5a18f995a8 volume: Deprecate '--retype-policy' in favor of '--migration-policy'
The '--retype-policy' option is used in the 'volume set' command to
specify the migration policy during the retype operation. The
'--retype-policy' option does not convey the correct meaning of its
usage. The migration policy determines whether we are going to perform
the migration in the retype operation or not and is not related to the
actual retype which just changes the volume type of the volume.

Change-Id: I2ea8fd3f5277bb3422ccae915d05e8ad44ff1912
2024-04-08 11:37:42 +01:00
Zuul 51f173c8cc Merge "Add router default route BFD/ECMP options" 2024-04-05 15:55:03 +00:00
Zuul 79974668b8 Merge "Add support for managing external gateways" 2024-04-05 15:55:01 +00:00
ArtofBugs 680e3e3011 identity: Migrate 'user' commands to SDK
Change-Id: I06f3848812bce60c65909f1311f36b70eba427d4
2024-04-04 16:22:56 -07:00
Stephen Finucane c86b9d8cc7 tests: Add identity v2, v3 FakeClientMixin
This ensures we are speccing the identity proxy API, as we did
previously for other services.

Change-Id: I4d090bab001f9b7e1d83ca8fee9e7e1117844cd8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-04 16:22:56 -07:00
Zuul 948034e6c1 Merge "router: Use plural form for storage of ``--fixed_ip`` argument" 2024-03-26 17:34:43 +00:00
Zuul 5f4236d7db Merge "Parse external-gateway argument in separate helper" 2024-03-26 17:34:41 +00:00
Cyril Roelandt 0970dd4096 image cache clear: fix value of default target
When using the "openstack image cache clear" command, the "clear_cache"
method from the OpenStack SDK is used. It expects its only argument to
be one of "both", "cache" or "queue". However, when passing neither
"--cache" nor "--queue", it is currently passed None as a value. Fix
this by specifying "both" as the default value to be passed.

Change-Id: I17c6e3d435a84b4ba453845086ff3fe272b54f58
2024-03-14 04:03:08 +01:00
Youngjun a4db11c62e refectoring: remove duplicate declaration
Change-Id: I0d9e3d25bc42df56be31defaea13bbe7aaa21caa
Signed-off-by: Youngjun <yj.yoo@okestro.com>
2024-03-13 10:04:04 +09:00
Youngjun 9e4dbd1d82 refectory: remove unreachable code
Change-Id: If12a550451f5aafe3e2fb5aaa0257319ea908fe3
Signed-off-by: Youngjun <yj.yoo@okestro.com>
2024-03-12 16:41:17 +09:00
Frode Nordahl 7184e876a5
Add router default route BFD/ECMP options
Add the `--enable-default-route-bfd`, `--disable-default-route-bfd`
`--enable-default-route-ecmp` and `--disable-default-route-ecmp`
options for `router create` and `router set` commands.

Related-Bug: #2002687
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
Change-Id: Ia5a196daa87d29445dc5514dcb91544f9d470795
2024-03-05 16:14:56 +01:00
Dmitrii Shcherbakov 16c695045c
Add support for managing external gateways
This change implements the logic to call the new API for managing
external gateways.

Relevant Neutron core change:
https://review.opendev.org/c/openstack/neutron/+/873593

Co-Authored-by: Frode Nordahl <frode.nordahl@canonical.com>
Related-Bug: #2002687
Change-Id: Ib45f30f552934a0a5c035c3b7fadfc0d522219ba
2024-03-05 16:14:56 +01:00
Frode Nordahl 58ad3cefa7
router: Use plural form for storage of ``--fixed_ip`` argument
The variable already takes multiple values, let's make it obvious
just by reading the code.

Related-Bug: #2002687
Change-Id: I294ee710d989d7a3a54331fca424e84708a2faab
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
2024-03-05 16:14:19 +01:00
Frode Nordahl f696aee81d
Parse external-gateway argument in separate helper
This is to prepare for subsequent patches that will add support
for managing multiple gateways.

Related-Bug: #2002687
Change-Id: Ic088dca0b7cd83bd7568d775b4e70285ce72411d
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
2024-03-05 11:26:15 +01:00
Rodolfo Alonso Hernandez 966051cfe2 Add NUMA affinity policy options "socket"
Added a new port NUMA affinity policy option called "socket".

Depends-On: https://review.opendev.org/c/openstack/neutron/+/910594

Related-Bug: #2052786
Change-Id: Icff9070db68ba83b47b344d56ee93b235383b2f2
2024-02-24 11:15:45 +00:00