Commit Graph

1215 Commits

Author SHA1 Message Date
Rajesh Tailor 533d5df516 Bump microversion to 2.96
This change bumps to microversion 2.96 and add
release notes.

Change-Id: I3b9775f1adecdca121a68a4caa6cd25e312dec2f
2024-03-07 17:30:06 +05:30
Rajesh Tailor 1f029ce578 Fix typos
Change-Id: Iaef3767dd9e7f43503dd8287b9b2345585bd87fb
2023-11-20 17:56:01 +05:30
David Wlazlo e464940f39 Typo - nova CLI deprecation warning
Change-Id: I1e604867bd00d51caebcb049777bbc675a398969
2023-05-17 12:21:29 +10:00
Artom Lifshitz 85e4f08309 Bump microversion to 2.95
There are no client-side changes for either 2.94 or 2.95, so just do
the bump and add release notes.

Change-Id: I8c2bfd48526840fc618820b9ae6a12dc98cdef45
2023-02-02 13:36:52 +00:00
Stephen Finucane 1d8a06da78 tests: Fix Python 3.11 compatibility
The argparse lib in Python 3.11 will not allow you to register a
subparser more than once with the same name. We were inadvertently doing
this in two of our unit tests as part of our check for version handling.
There's no need for this. Stop doing it and simply create a new parser
each time.

An unnecessary check is removed from one of the tests since it confuses
matters.

Change-Id: I93827f84c456c9f6960e30e2424b67947254752c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-12-12 17:49:26 +00:00
Takashi Natsume 2af1d0c514 Remove unnecessary testing code
Now PrettyTable >= 0.7.2 in requirements.txt,
remove code for PrettyTable < 0.7.2.

Change-Id: Ie6edcc24fbb67394ff8abe0c5f18ad2bed6903ab
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-09-19 01:12:04 +00:00
whoami-rajat 94d3445e10 MV 2.93 - Add support to rebuild boot volume
This patch bumps the API microversion to 2.93 to allow
rebuilding a volume backed instance.

Implements: blueprint volume-backed-server-rebuild

Depends-On: https://review.opendev.org/c/openstack/nova/+/830883

Change-Id: Ie46df7ad76082e7631bb26243abed4dc3b1f40ac
2022-09-06 16:42:08 +05:30
Takashi Natsume be9517cb02 Fix a fixture for keypairs tests
This patch is a follow-up for
I03570d0a49b73021de91dc50b65b1bbf5d4b878b.

The following file is for shell (CLI) tests,
so it does not need to be changed anymore.

* novaclient/tests/unit/v2/fakes.py

Change-Id: I3b1cf5d402b04854177265f2ba429956edb73203
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-08-05 23:58:30 +09:00
Zuul cdea416cce Merge "Add support for 2.92 : keypair import mandatory" 2022-08-02 16:03:40 +00:00
Zuul 89a76edc8d Merge "Microversion 2.91: Support specifying destination host to unshelve" 2022-08-02 15:47:54 +00:00
Sylvain Bauza 2b5d989990 Add support for 2.92 : keypair import mandatory
Now, when creating a keypair, the 'public_key' parameter is now mandatory.

Depends-On: https://review.opendev.org/c/openstack/nova/+/849133
Implements: blueprint keypair-generation-removal

Change-Id: I03570d0a49b73021de91dc50b65b1bbf5d4b878b
2022-07-28 14:59:47 +02:00
René Ribaud ee9b277c5f Microversion 2.91: Support specifying destination host to unshelve
This patch adds ``host`` to novaclient api.
This can help administrators to specify a ``host``
to unshelve a shelve offloaded server from 2.91 microversion.

Depends-On: https://review.opendev.org/c/openstack/nova/+/831507
Implements: blueprint unshelve-to-host
Change-Id: I7efc8f0b0ef159e16cefee761bff5d7e90d0c427
2022-07-28 14:49:46 +02:00
Stephen Finucane c408db2dd9 Update pre-commit hook, hacking versions
This was done with 'pre-commit autoupdate'. An invalid message is
removed from the requirements.txt files as it no longer applies with
pip's new dependency resolver.

Change-Id: I01c3ece51f81d67c740e6faca6b77df7c9932435
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-04-08 17:49:08 +09:00
Stephen Finucane 0fb7190c06 Deprecate nova CLI
It is time to signal that we're fully committed to delivering a pure
OSC experience.

Based on the neutron change from 6 (!!) years ago [1]

[1] 3a64a7a166

Change-Id: Ib80548e104a751179f36f2a6ebff9916d38fdf1e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-04-06 14:17:59 +01:00
Stephen Finucane 8066f8c745 Microversion 2.90 - Configurable hostnames
Change-Id: Icd4362a07196e59bafcdfaff44323ce1386d4f55
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/nova/+/778550/
2021-09-02 11:01:07 +01:00
Stephen Finucane 01c7a3aa10 tests: Add missing 'nova update' unit tests
We have functional tests for the 'nova update' commands, but no unit
tests to verify e.g. that we can't set a description for the server
before microversion 2.19. Add such tests.

Change-Id: I9af89655a7e7276446a881fd28d21ddd6581048c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-09-02 10:50:52 +01:00
Lee Yarwood cfa172c4fd Microversion 2.89 - os-volume_attachments
Depends-On: https://review.opendev.org/c/openstack/nova/+/804275
Change-Id: If6275dbd3795047c111ac507a12b034e60029df8
2021-08-24 19:10:41 +01:00
Takashi Kajinami bff8d41370 Use importlib instead of imp
... because the imp module is deprecated since Python 3.4 .

Closes-Bug: #1937904
Change-Id: Ia3f83df336fd243c25f7471d56a44370c11bb5e1
2021-08-16 09:55:38 +09:00
Takashi Kajinami 273c41574a Use Block Storage API v3 instead of API v2
Block Storage API v2 was deprecated during Pike cycle and is being
removed during Xena cycle, and current v3 API should be used instead.

Change-Id: I4b4c08d65e642866d81d7fd12a7c82162a0b979e
2021-07-27 11:00:23 +09:00
melanie witt 21edd11ba9 Add unit tests for client logger
Change I53caceb08667eb12e27016731868e8015dd10e34 fixed a bug where we
weren't using our novaclient logger default when a logger was not
passed to the Client constructor.

This adds unit tests to assert the fixed behavior and protect against
regression.

Related-Bug: #1921388

Change-Id: I9f622c01a6b1abe328a60de6d3e438e68872dd80
2021-04-10 03:10:04 +00:00
Stephen Finucane 54d4da112a Add support for microversion v2.88
The key change here is that the 'GET /os-hypervisors/{id}/uptime' API
will now returns a HTTP 404 starting in 2.88. The 'GET
/os-hypervisors/{id}' will instead now include an 'uptime' value. The
'novaclient.v2.hypervisors.HypervisorManager.uptime' method is updated
to handle this.

Change-Id: Ib99fbd820a586c14527ff64b319df0b7a44e1b8b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-03-02 12:14:12 +00:00
Takashi Natsume 9b474afdb2 Deprecate agent commands and APIs
The os-agents APIs have been removed by the following change.

  I9512f605dd2b3b0e88c951ed086250d57056303d

This patch makes commands related to the APIs deprecated
in accordance with the following policy.

* https://docs.openstack.org/python-novaclient/latest/contributor/deprecation-policy.html

The API bindings related to the APIs remains as they are
because python-openstackclient depends on the API bindings.

Change-Id: I89d7877e23e8802fe77987a7b24ea247e08d5218
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2021-01-13 14:43:51 +00:00
Takashi Natsume e85d845b1a Fix undesirable raw Python error
Using the novaclient without a subcommand while
passing an optional argument triggers the raw Python
error `ERROR: 'Namespace' object has no attribute
'func'`. This bug can be reproduced by issuing the
command `nova --os-compute-api-version 2.87`.
Added a default value to `func` and an empty value to
`command` as placeholders so that a help message is
shown instead of the Python error.

Change-Id: Ic3e87b67f6d27d40b03d7d8e520fa0f79a4d09e5
Closes-Bug: #1903727
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2021-01-04 13:49:20 +09:00
Takashi Natsume 1b5f29a3a4 Fix a functional test for 'nova agent-list'
The os-agents APIs have been removed by the following change.

  I9512f605dd2b3b0e88c951ed086250d57056303d

This patch fixes a gate failure.
A subsequent patch will make things related to
the os-agents APIs deprecated.

Change-Id: I9dab95fda5902bf9619393eb2c4a22d9f395d65a
Closes-Bug: #1909899
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2021-01-03 21:46:49 +09:00
Takashi Natsume 2ed34e657c Remove unused code
The code has not been used
since If0161a89877f19f24e91d780cf227fdc48e7e860 .

Change-Id: I106404f9d12814fec2ec2bf16cdd100834085912
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2020-07-31 11:28:24 +00:00
Takashi Natsume 1ce9edcd73 Add a cleanup for a server in a functional test
A VM instance is created in the following functional test.

* novaclient.tests.functional.v2.test_instance_action.
  TestInstanceActionCLIV262.test_show_actions_with_host

However the VM instance is not deleted after the functional test.
Add a cleanup for the server in the functional test.

Change-Id: I8c2a6f91739d50baa283b37b16de67c542ea691b
Closes-Bug: #1889283
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2020-07-28 16:36:28 +00:00
Zuul 51de7e320a Merge "use stevedore to load extensions" 2020-07-09 19:03:35 +00:00
Takashi Natsume b7ae8c75cb Switch legacy Zuul jobs to native Zuul v3 jobs
Replace the 'novaclient-dsvm-functional' legacy Zuul job with
the 'python-novaclient-functional' native Zuul v3 job.

See
https://governance.openstack.org/tc/goals/selected/victoria/native-zuulv3-jobs.html
for more details.

Change-Id: I35b5699b8b0814f2d17a37e024286cd440047ec8
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Co-Authored-By: Andrey Kurilin <andr.kurilin@gmail.com>
2020-07-08 20:33:05 +03:00
Doug Hellmann 109d41e722 use stevedore to load extensions
Importing pkg_resources causes the app to scan the entire import path
for all distributions, not just those providing entry points. The
scanner in stevedore will have a cache of the entry point data, making
it significantly faster. This will be especially useful in command
line programs like python-openstackclient.

Change-Id: Ic5eb9401c8ea3bd9624b818e0ffb8dcc13f61559
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2020-07-08 08:53:07 -04:00
Takashi Natsume 7ef2c28bf3 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: I4d45ae17f6f84f945f5dd049a929216ce6b6b58e
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2020-04-26 10:12:09 +00:00
Zuul 3ef5b695ca Merge "Microversion 2.87 - Stable device boot from volume rescue" 2020-04-10 22:53:29 +00:00
Lee Yarwood 7ed265bbf5 Microversion 2.87 - Stable device boot from volume rescue
This microversion is used to request a stable device rescue for boot
from volume instances and will only succeed when the compute hosting the
instance reports the COMPUTE_RESCUE_BFV trait.

No changes are required within novaclient so this change only bumps
API_MAX_VERSION.


Depends-On: https://review.opendev.org/#/c/701430/

Change-Id: I7885b8558db7657abbfe1f45877f52e947f5f655
2020-04-10 20:15:05 +00:00
Zuul 9bd1c3d321 Merge "Microversion 2.86 - Extra spec validation" 2020-04-10 09:06:25 +00:00
zhangbailin c5f29d6833 FUP: Add volume-update CLI pre V285 tests
This commit mainly to fix some comments from [1].

[1]https://review.opendev.org/#/c/712651/19/novaclient/tests/unit/v2/test_shell.py@4001

Blueprint: destroy-instance-with-datavolume
Change-Id: Id809f22d0da2cdedf33a2c0df202f3953fd01673
2020-04-10 08:39:39 +08:00
Lee Yarwood ca1262daeb Microversion 2.86 - Extra spec validation
This microversion introduces extra spec validation within the API.

No changes are required within novaclient so this change only bumps
API_MAX_VERSION.

Depends-On: https://review.opendev.org/#/c/708436/

Change-Id: Ic8fef7ee363435e9ac728b87d494593fcc6defc0
2020-04-09 20:46:09 +09:00
zhangbailin 4d6c70d25d Microversion 2.85: Change volume-update CLI
This commit add a new CLI
``nova volume-update [--[no-]delete-on-termination]
<server> <src_volume> <dest_volume>`` to update
'delete_on_termination' for an attached volume, that the user can
decide whether to delete attached volumes when destroying the server.

Depends-On: https://review.opendev.org/#/c/711194/

Change-Id: I1fc64fb6e6611c92c6b72265e1bf4b32e9c45f0a
Blueprint: destroy-instance-with-datavolume
2020-04-09 08:52:05 +08:00
Stephen Finucane ea092b2988 Make 'server list --config-drive' a boolean option
Instead of passing through whatever the user provides and exposing this
bug in the REST API, simply make the opt a boolean one in expectation of
a day where the API issues have been resolved.

This also introduces machinery necessary to use more of these types of
opts in the future.

Change-Id: I9033540ac65ac0ee7337f16bdd002060652092ea
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-04-08 17:27:33 +01:00
zhangbailin d712c0fbc7 Microversion 2.84 - action event fault details
This patch adds support for microversion 2.84
"Expose instance action event details out of the API" [1].

[1] https://review.opendev.org/#/c/694430/

No changes are required in the novaclient side,
so just increment the microversion.

Depends-On: https://review.opendev.org/#/c/694430/

Implements blueprint action-event-fault-details
Change-Id: I1d71284de9a5f25f4554dd2ec7291d5706381de7
2020-04-08 04:10:35 +00:00
Victor Coutellier 9ee74d3ac6 Microversion 2.83 - Add more filters for the nova list command
Add these new filters, admin-only until microversion 2.82:

- availability-zone
- config-drive
- key-name
- power-state
- task-state
- vm-state
- progress

Existing user filter will be available to non admin since microversion
2.83.

Part of blueprint non-admin-filter-instance-by-az

Change-Id: Id2b5e600c0a41790830823031b20983808cb5ace
2020-04-07 18:34:13 +02:00
Takashi Natsume 0ab746b4d1 Microversion 2.82 - nova cyborg interaction
This patch adds support for microversion 2.82
"Define Cyborg ARQ binding notification event" (*).

*: I7a626544d8221dc0eeb5672986ca897ce4718be8

No changes are required in the novaclient side,
so just increment the microversion.

Change-Id: I3a8a2f8b5ced5519082f0b7609702d4f62be88ac
Implements: blueprint nova-cyborg-interaction
2020-03-12 23:49:23 +09:00
Stephen Finucane 03dca4bc82 Don't print user_data for 'nova show'
User data is a blob of data that the user can specify when they launch
an instance. It's generally binary data, which means it's not something
we should show by default on the CLI. Stop doing that.

Change-Id: If8f6cc040d0077a7902a5fd425e67d74d7925a46
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1669140
2020-02-26 13:48:11 +00:00
Stephen Finucane b9a7e03074 Random cleanups
Remove some cruft from Sphinx config files, drop the use of 'u' prefixed
strings, which are unnecessary in Python 3, and generally tidy stuff up.

Change-Id: Ib0f33576e160ec842d7fc82b4fcfee99829623d7
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-21 09:56:37 +00:00
Stephen Finucane 8f50f84981 Bump to hacking 2.x
This is compatible with Python 3-only syntax.

Change-Id: I462f4242b9a5f8d8cd6b0cb3d328dfd9d93ba200
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-21 09:48:38 +00:00
Stephen Finucane c4c44bcb2d Remove six
Mostly a find-replace job. Let's do this now so we don't have to carry
it for the next decade.

Change-Id: I7bef9fb7c6895f746cee1aca6522786f38b9857c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-21 09:48:38 +00:00
Stephen Finucane 0f7d723c46 trivial: Remove 'u' prefix from string
It looks like nova is using 'repr()' in some validation error logging.
On Python 2.7, this would result in unicode strings (which most web apps
use) being output as "u'foo'", while in Python 3 these would just be
"'foo'". Since nova only supports Python 3 now, we only have to support
the Python 3 string formatting variant in our tests too.

Change-Id: I546c06a3251e86f39e2e7db48e04ec382c8da854
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-21 09:43:13 +00:00
Zuul 9cae96174a Merge "Add minor version [21] to the test_versions" 2019-11-13 14:59:46 +00:00
zhangbailin c15a5a0555 Add minor version [21] to the test_versions
In v2.21, the os-instance-actions API returns information from deleted
instances. This change does not involve changes to novaclient, but
since novaclient does not add support for v2.21, it does not match
API_MAX_VERSION when executing unit tests
(novaclient.tests.unit.v2.test_shell.ShellTest.test_versions).

Closes-Bug: #1848110
Change-Id: Ib1ad244bb059bb86a9f3025d4bc16c20946433d0
2019-10-22 07:52:43 +08:00
Zuul 380fc08513 Merge "Add functional test for migration-list in v2.80" 2019-10-19 17:48:53 +00:00
Dan Smith 71c29a184b Add aggregate-cache-images command and client routines
This adds the ability to request image precache support for an aggregate
in support of the matching server feature.

Related to blueprint image-precache-support

Depends-On: https://review.opendev.org/#/c/687140
Change-Id: Id354ccfa99e500a598685e6b794c12160ea2a990
2019-10-18 10:50:01 -07:00
Dan Smith e1bb4378db Add images.GlanceManager.find_images() bulk query
This adds a bulk query method to GlanceManager that takes multiple
image names or ids and attempts to query glance for all of them
in fewer requests than one-per-image.

Change-Id: I1c6ce27b65920356df6b7001c581a2922765ce0c
2019-10-18 10:49:53 -07:00