Commit graph

5103 commits

Author SHA1 Message Date
Dr. Jens Harbott
06350b0853 [stable-only] CI: Drop all tips jobs
None of the -tips jobs should run on stable branches, so we can stop
defining them here.

Conflicts: .zuul.yaml
amended for older job names

Manually dropped osc-image-* jobs as those are failing and this
branch is soon transitioning to unmaintained state.

Change-Id: I4d39c33b03a674c77afce7107f7e76292cd44511
(cherry picked from commit 41381c80b5)
2024-02-08 15:35:02 +01:00
Douglas Mendizábal
ecaa2805dc Fix "access rule" commands to only use ID
This patch modifies the access rule commands to use only the resource
ID.  The previous logic incorrectly assumed that access rules have a
"name" property, which resulted in unexpected behaviors.

For example, "access rule delete {non-existent-id}" now results in a
"not found" error instead of sometimes deleting an unrelated rule.

Story: 2010775
Task: 48163
Change-Id: Ib5c3b7f86acf1dfe7cc76dfa99fa4c118388bd71
(cherry picked from commit 560f19b894)
2023-07-14 14:00:08 -04:00
Artem Goncharov
8117758c28 Fix pep issue in the network service provider
pep gods started complaining (correctfully) about spacing in the old
command. Apply `black -l 79` on the file to make it looking nice and
passing checks.

Change-Id: I716f6a1496fc552b32809c7eb744283f3a3cd5a4
(cherry picked from commit bf758a6385)
2023-07-14 13:59:50 -04:00
Zuul
d6ea23e557 Merge "[stable-only] Add munch in requirements.txt" into stable/wallaby 2023-02-01 07:12:54 +00:00
Ghanshyam Mann
d00fe107e7 [stable-only] Add munch in requirements.txt
'munch' module is used in openstackclient/network/sdk_utils.py
- db417598ed/openstackclient/network/sdk_utils.py (L13)

and in upstream testing (openstacksdk-functional-devstack job)
was installing it via sdks requirements.txt which was removed
recently and end up failing this job for <=stable/xena
- https://review.opendev.org/c/openstack/openstacksdk/+/865045

and end up failing openstacksdk-functional-devstack job for <=stable/xena
- https://zuul.openstack.org/builds?job_name=openstacksdk-functional-devstack&branch=stable%2Fxena&skip=0

This is case for <=stable/xena only as openstackclient/network/sdk_utils.py
is not present after that.

Change-Id: I2a88e79d134ec1362e8361629cb2a8ae14dc7b67
(cherry picked from commit e6da07b977)
2023-01-31 11:44:37 -06:00
Alfredo Moralejo
42d9b6ea57 Replace assertItemsEqual with assertCountEqual
Similar to [1] required after adding some new tests in [2]

[1] https://review.opendev.org/c/openstack/python-openstackclient/+/805790
[2] https://review.opendev.org/c/openstack/python-openstackclient/+/819938

Change-Id: I6f4f867048793f9e1e1a05afa4f2beaf8def5053
2023-01-31 16:58:48 +01:00
Stephen Finucane
e1872e01bf volume: Allow more versions
Copy the API version checks from the 'openstackclient.compute.client'
module. These will only be necessary until we migrate everything to SDK
but it's very helpful until then.

Change-Id: I2d9c68db5bf891ffa25fd5a7fc9e8953e44b73ab
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
(cherry picked from commit 0f28588e48)
2023-01-11 17:45:09 +00:00
Stephen Finucane
92dafb3a19 compute: Note that '--password' is deployment-specific
Password injection requires either hypervisor-support or an agent
running in the guest that will talk to the metadata service. It can be
disabled for a deployment using the '[api] enable_instance_password'
nova config option. Indicate this, albeit briefly.

Change-Id: Ief94ea07fc7ab6a487af972e8759ca6704d8f085
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
(cherry picked from commit 280b14abcd)
2022-12-13 16:15:36 +00:00
whoami-rajat
ad924068f8 compute: Require image when rebuilding a volume-backed server
A volume-backed server will have no image attribute (or rather the image
property will be set to the empty string). As such, if you want to try
rebuild you will need to specify an image [*]. Enforce this.

[*] Before microversion 2.93, this must be the same image. However, we
don't touch on that here. This will be addressed later.

Change-Id: I6842dabd7acb4e3a78f894e55e616625757eb6a4
Story: 2010297
Task: 46290
(cherry picked from commit 1f63034441)
(cherry picked from commit 0118d57c02)
(cherry picked from commit 53d8667b4b)
(cherry picked from commit db417598ed)
2022-09-30 11:33:46 +01:00
Zuul
5c9661c15a Merge "compute: Show flavor in 'server list' with API >= 2.47" into stable/wallaby 2022-07-05 14:07:26 +00:00
Zuul
717383cf86 Merge "compute: Reorder building of columns for 'server list'" into stable/wallaby 2022-07-05 14:07:25 +00:00
Zuul
acc5f202a3 Merge "Fix typo error in listing server's column name" into stable/wallaby 2022-07-05 14:07:18 +00:00
Zuul
a17eef1b6a Merge "Fix: create image from volume command" into stable/wallaby 2022-07-04 13:38:29 +00:00
Zuul
2e6284b091 Merge "Stop testing lower-constraints" into stable/wallaby 2022-07-04 13:32:21 +00:00
whoami-rajat
9425e6fcb6 Fix: create image from volume command
Currently the command ``openstack image create --volume`` calls cinderclient
to upload the volume to image service (glance) but OSC passes ``visibility``
and ``protected`` fields which are only available in microversion 3.1 or
greater. This generates an error if the user is using volume microversion
< 3.1 and wants to create an image from volume.
This patch fixes that by only passing ``visibility`` and ``protected`` fields
when the volume microversion is 3.1 or greater and fail otherwise i.e. the
following 3 cases:
1) visibility/protected argument + mv >= 3.1 = pass
2) visibility/protected argument + mv < 3.1 = fail
3) not visibility/protected argument + any mv = pass

Changes:
  openstackclient/tests/unit/volume/v3/fakes.py
  
NOTE(croelandt): Imported openstackclient/tests/unit/volume/v3/fakes.py from
the Yoga branch. Used FakeType instead of FakeVolumeType for compatibility with
older class names.

Story: 2010060
Task: 45511
Change-Id: I568a0ea0af8f7f82b16d49a6a1bb0391b99c50dc
(cherry picked from commit 9eea28ba59)
(cherry picked from commit 849e7e93f8)
(cherry picked from commit 665d93ff07)
2022-07-04 11:35:48 +00:00
likui
40f56c653c Stop testing lower-constraints
[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-October/018445.html

Conflicts:
  .zuul.yaml
  lower-constraints.txt

NOTE(stephenfin): Conflicts are due to the changed job template (wallaby
vs xena) and slightly different lower constraints between branches.

Change-Id: I45e9a81d451c64cdd51f9b606d94161742bacdb7
(cherry picked from commit c677192d51)
(cherry picked from commit cde8db3d61)
2022-07-04 11:23:25 +01:00
Cyril Roelandt
b39fe0b463 openstack image create: honor protection/visibility flags
The --protected, --unprotected, --public, --shared, --community,
--private flags were ignored when using --volume.

Change-Id: Id5c05ef7d7bb0a04b9d7a9d821e544e1ff7b3d28
Story: 2008882
(cherry picked from commit 3918622968)
2022-07-01 15:34:13 +02:00
Khomesh Thakre
4b7e777c0c compute: Show flavor in 'server list' with API >= 2.47
Fix the issue where the flavor name was empty in server list output.
This requires somewhat invasive unit test changes to reflect the changed
API response from the server, but this has the upside of meaning we
don't need new tests since what we have validates things.
Also drop the flavor ID column as it is removed from the compute API.

Change-Id: Ica3320242a38901c1180b2b29109c9474366fde0
Signed-off-by: Khomesh Thakre <khomeshthakre24@gmail.com>
Story: 2008257
Task: 41113
(cherry picked from commit 8e362402de)
(cherry picked from commit 0873e7580e)
2021-12-01 01:35:10 +00:00
Stephen Finucane
cb621f22d4 compute: Reorder building of columns for 'server list'
This has no impact on the end result, but it should make fixing issues
introduced by API microversion 2.69 a little easier.

Change-Id: I7d70eac8aa1a6197ed05a49f071e6899ec219c03
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
(cherry picked from commit 4c3de28e83)
(cherry picked from commit f4adbcef7b)
2021-12-01 01:34:56 +00:00
LEE JAE YONG
e1a764823c Fix typo error in listing server's column name
openstack server list -c "Created At" command doesn't work
because the wrong variable was used here.

When we receive resp data, Created At data is saved with
the name "created". But in "server.py", we append columns
as created_at. So it seems to print an empty table.

Story: 2009149
Task: 43112
Change-Id: I06de6903d5cc427a8b0fdcd168fec47192f4365b
(cherry picked from commit 4aad7dd779)
(cherry picked from commit e53d034fc8)
2021-12-01 01:34:36 +00:00
Stephen Finucane
3f4142d5dd compute: Fix filtering servers by tags
The nova API expects the 'tags' and 'not-tags' filters of the 'GET
/servers' (list servers) API to be a CSV string [1]:

  tags (Optional)
    A list of tags to filter the server list by. Servers that match all
    tags in this list will be returned. Boolean expression in this case
    is 't1 AND t2'. Tags in query must be separated by comma.

    New in version 2.26

  not-tags (Optional)
    A list of tags to filter the server list by. Servers that don’t
    match all tags in this list will be returned. Boolean expression in
    this case is 'NOT (t1 AND t2)'. Tags in query must be separated by
    comma.

    New in version 2.26

We were instead providing a Python list, which was simply being URL
encoded. Correct this.

[1] https://docs.openstack.org/api-ref/compute/?expanded=list-servers-detail#list-servers

Change-Id: Ie0251a0dccdf3385089e5bbaedf646a5e928cc48
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1946816
(cherry picked from commit 53debe7fe1)
(cherry picked from commit cbc64f9469)
2021-10-13 12:51:28 +01:00
Dirk Mueller
53f1efa010 Replace assertItemsEqual with assertCountEqual
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.

[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277

Conflicts:
      openstackclient/tests/unit/volume/v2/test_volume_snapshot.py
NOTE(jpena): This file is not present in stable/wallaby

Change-Id: I0bbffbec8889b8b3067cfe17d258f5cb16624f38
(cherry picked from commit e82a05864f)
2021-08-24 09:21:45 +00:00
OpenStack Release Bot
d50045e484 Update TOX_CONSTRAINTS_FILE for stable/wallaby
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.

Until the requirements repository has as stable/wallaby branch, tests will
continue to use the upper-constraints list on master.

Change-Id: I8285fd4d67487f6213ba03dcb6ebe673bd819e77
2021-03-20 09:16:46 +00:00
OpenStack Release Bot
2aea1fa4b0 Update .gitreview for stable/wallaby
Change-Id: I2dc1ea5578a3b648a489830df64f010420cca8c1
2021-03-20 09:16:42 +00:00
Zuul
86bca18b74 Merge "project cleanup" 2021-03-18 08:39:11 +00:00
Takashi Kajinami
791bed6dd2 Update the file paths mentioned in README.rst
This change fixes the outdated file paths, which were renamed by commit
9599ffe65d .

Change-Id: I9ec4c49711a2fde24f5527086e495c86af9ef1ce
2021-03-15 23:29:53 +09:00
Stephen Finucane
2ccf7727a6 compute: Remove 'file://' prefix from '--block-device'
There are a couple of other (networking-related) options which accept
paths, none of which insist on a URI-style path. Let's just drop this
bit of complexity before we release the feature.

Change-Id: Ia7f781d82f3f4695b49b55a39abbb6e582cd879c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-03-11 15:56:59 +00:00
Zuul
ae1f8f888a Merge "compute: Add support for loading BDMs from files" 2021-03-11 12:51:47 +00:00
Zuul
e6b0473b8b Merge "compute: Add functional tests for --block-device" 2021-03-11 12:44:47 +00:00
Zuul
274d1eeffb Merge "network: Add missing subnet unset --gateway <subnet-id>" 2021-03-06 13:57:27 +00:00
Zuul
9414435607 Merge "Add reno for change Ic3c555226a220efd9b0f27edffccf6c4c95c2747" 2021-03-06 11:41:23 +00:00
Bharat Kunwar
ed731d6cd9 network: Add missing subnet unset --gateway <subnet-id>
Story: 2008695
Task: 42003
Change-Id: I9486a09531b11f27a9ff0d68fd4ad8c68a65cccf
2021-03-05 14:15:20 +00:00
Stephen Finucane
d3bd0146ae compute: Add support for loading BDMs from files
The syntax of the '--block-device' parameter is complex and easily
screwed up. Allow users to load a block device config from a file. For
example:

  $ openstack server create ... --block-device file:///tmp/bdm.json ...

This should alleviate the pain that is BDMv2 somewhat.

No functional tests are provided since we already have tests for the CSV
style of passing parameters and the unit tests show that the net result
is the same.

Change-Id: I3e3299bbdbbb343863b4c14fb4d9196ff3e1698d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-03-05 13:11:09 +00:00
Stephen Finucane
7c1d6f769c compute: Add functional tests for --block-device
This mostly reuses the existing tests for '--block-device-mapping',
which can hopefully be removed at some point in the future.

This highlights two issues with the implementation of this option.
Firstly, the 'boot_index' parameter is not required so don't mandate it.
Secondly, and more significantly, we were defaulting the destination
type for the 'image' source type to 'local'. Nova only allows you to
attach a single image to local mapping [1], which means this default
would only make sense if you were expecting users to use the
'--block-device' option exclusively and omit the '--image' option. This
is the *less common* case so this is a bad default. Default instead to a
destination type of 'volume' like everything else, and require users
specifying '--block-device' alone to pass 'destination_type=local'
explicitly.

[1] https://github.com/openstack/nova/blob/c8a6f8d2e/nova/block_device.py#L193-L206

Change-Id: I1718be965f57c3bbdb8a14f3cfac967dd4c55b4d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-03-05 12:44:52 +00:00
Zuul
a507fb50f8 Merge "compute: Remove deprecated 'server migrate --live' option" 2021-03-04 21:29:55 +00:00
Zuul
979b4832dd Merge "compute: Deprecate 'server create --file'" 2021-03-04 21:29:48 +00:00
Zuul
8e94044710 Merge "compute: Stop silently ignore --(no-)disk-overcommit" 2021-03-04 21:29:38 +00:00
Zuul
9aad6b8f9e Merge "compute: Auto-configure shared/block live migration" 2021-03-04 21:29:26 +00:00
Zuul
e260d43d94 Merge "compute: Add 'server create --block-device' option" 2021-03-04 21:28:59 +00:00
Zuul
d94d2f1213 Merge "compute: Remove references to optional extensions" 2021-03-04 21:28:31 +00:00
Zuul
93c9b914a6 Merge "compute: Add missing 'server create' options" 2021-03-04 21:28:13 +00:00
Zuul
433ceff051 Merge "compute: Improve 'server create --block-device-mapping' option parsing" 2021-03-04 21:27:44 +00:00
Zuul
1f6104c760 Merge "compute: Rename 'server migrate (confirm|revert)'" 2021-03-04 16:51:57 +00:00
Zuul
855dc79a87 Merge "compute: Add 'server migration show' command" 2021-03-04 16:51:40 +00:00
Zuul
82770fa6c0 Merge "Rename FakeServerMigration to FakeMigration" 2021-03-04 16:51:12 +00:00
Zuul
e8a50692a0 Merge "compute: Add support for 'server boot --nic ...,tag=<tag>'" 2021-03-04 16:50:58 +00:00
Zuul
af18b514ef Merge "compute: Improve 'server create --nic' option parsing" 2021-03-04 13:21:31 +00:00
Zuul
b9f61f7b30 Merge "compute: Shuffle options for 'server create'" 2021-03-04 13:21:10 +00:00
Zuul
d4f8aa163d Merge "compute: Add missing options for 'server event list'" 2021-03-04 13:20:35 +00:00
Zuul
1c84b44ac2 Merge "Add --name to port list" 2021-03-03 17:03:02 +00:00