With the 2.57 microversion, we:
* Deprecate the --file option from the nova boot and
nova rebuild CLIs and API bindings.
* Add --user-data and --user-data-unset to the nova rebuild
CLI and API bindings.
* Deprecate the maxPersonality and maxPersonalitySize fields
from the nova limits and nova absolute-limits CLIs and API
bindings.
* Deprecate injected_files, injected_file_content_bytes, and
injected_file_path_bytes from the nova quota-show,
nova quota-update, nova quota-defaults, nova quota-class-show,
and nova quota-class-update CLIs and API bindings.
Part of blueprint deprecate-file-injection
Change-Id: Id13e3eac3ef87d429454042ac7046e865774ff8e
Heat wants to use 'novaclient.v2.servers.
ServerManager._console' method to simplify the
implementation of retrieving server console.
It's better to change the method to public for
public use.
The patch changes:
1. add public method named get_console_url() for class
'novaclient.v2.servers.Server'
2. rename _console() to get_console_url() for class
'novaclient.v2.servers.ServerManager'
Change-Id: I3d1485468d1d0a79d4002981ebe05b6cdf2332e7
Closes-Bug: #1651677
The support for non-keystone auth systems and plugins
was deprecated with 1f11840dd84f3570330d1fcd53d1e8eea5ff7922
back in the 3.1.0 release in mitaka.
Now that we're working on shoring up the support for
keystone auth sessions in the client and eventually moving
to remove support for the non-session HTTPClient, we should
also remove the support to load non-keystone auth plugins.
The whole concept of non-keystone auth systems/plugins is
a legacy artifact and is a barrier to interoperability which
is a goal of nova and OpenStack in general.
Change-Id: Ia649db257c416ca054977812ecb3f1a8044fa584
WebOb change https://github.com/Pylons/webob/pull/230 changed
the way in which the error response body is formatted such that
it's no longer a nested dict. So we have to handle both the
old convention of an error message key to the response body error
dict and the new way with just the error body dict.
This was reported upstream:
https://github.com/Pylons/webob/issues/235
But given this was apparently implemented as a long-overdue change
in WebOb the behavior is not likely to change.
Change-Id: If653a247d842786d2824b4b3a5c0cde1383ed7ab
Closes-Bug: #1559072
2.19 - Allow the user to set and get the server description. The user will
be able to set the description when creating, rebuilding, or updating
a server, and get the description as part of the server details.
Methods `rebuild` and `create` of novaclient.v2.servers.ServerManager were
not wrapped with `api_versions.wraps` decorator to reduce code and docsting
duplication. Version checks added inside these methods.
Change-Id: I75b804c6edd0cdf02c2cd002d0b5968fec8da545
NOTE: _poll_for_status is a private method, which is used only in shell
module, so we can modify it without backward compatibility.
_poll_for_status is used for various resources with different interfaces.
In case of snapshotting, it works with Image resources, which doesn't have
"fault" attribute in "error" state. To prevent AttributeError, we should take
this into account.
Also, an exception raised by _poll_for_status(InstanceInErrorState) should
not be hardcoded for one type of resource, so this exception is renamed to
ResourceInErrorState. An exception InstanceInDeletedState, which is also
can be raised by _poll_for_status, is not modified, since I don't know cases
when it can be used with resources other than Server.
Change-Id: Ie0ee96999376cbf608caa1cf8521dbef5c939b52
Closes-Bug: #1538073
Wrong usage of "a/an" in the messages:
"It will be deprecated after an suitable deprecation"
"Delete metadata from an server"
"Get a list of actions performed on an server"
"based on an requests response"
"Get a aggregate by name or ID"
Should be:
"It will be deprecated after a suitable deprecation"
"Delete metadata from a server"
"Get a list of actions performed on a server"
"based on a requests response"
"Get an aggregate by name or ID"
Totally 5 occurrences in python-novaclient base code.
Change-Id: Iabe764f8b547b39431deb34221266695e0e79fa9
As a stepping stone to the os-client-config patch, first switch to
using keystoneauth, its Session and its argparse registration and
plugin loading to sort out any issues with that level of plumbing.
The next patch will layer on the ability to use os-client-config
for argument processing and client construction.
Change-Id: Id681e5eb56b47d06000620f7c92c9b0c5f8d4408
This reverts commit 2961e82bfa6e375ac3c17933fac532ed316ac976
This broke cinder unit tests that have a timeout test for novaclient
where they mock the requests library raising a Timeout exception. That
test expects to get a requests Timeout passed through but with the
change being reverted it was getting a RequestTimeout exception from
novaclient, which breaks the test and fails the gate runs.
We could change the cinder unit test to handle both the requests.Timeout
and the new novaclient RequestTimeout, but that's just papering over
the cinder failure, we wouldn't know what other clients are failing
in the same way because they have code working around the requests
exceptions getting passed through, so we should treat this like an API
change.
I'd be in favor of making the same change again iff the novaclient
exceptions extended the requests exception types so it would be transparent
to consumers, since novaclient.exceptions.RequestTimeout would be a
requests.Timeout via inheritance. But given the gate breakage and it being
summit week I'm inclined to revert first and think about a better long term
fix later when people are back to discuss.
Change-Id: I368728588e5997eef860a168539eb66c58f2e72a
Closes-Bug: #1510790
Novaclient expects the requests library to always be able to get a
response back and doesn't handle other cases where it might raise
an exception even before the request is completed (e.g.
ConnectionError).
These exceptions should be captured and properly converted to some
native novaclient exception.
Change-Id: Iec7247b715c38c29910b30e76413cead4e951a37
Co-Authored-By: Kuo-tung Kao <jelly.k@inwinstack.com>
Closes-Bug: #1406586
When use command '--poll' to show progress, if the object's staus change
into 'deleted' for some reason, it will lead a endless loop.Becasue there
is no check about 'deleted' status.
For example, when use 'image-create --poll' to create a vm's snapshoot,
if glance's quota is small than the snapshoot, the image will be deleted.
Change-Id: I028e3064b3371f87873d74494c39255775a2c818
Closes-bug:#1470047
New decorator "novaclient.api_versions.wraps" replaces original method with
substitution. This substitution searches for methods which desire specified
api version.
Also, this patch updates novaclient shell to discover versioned methods and
arguments.
Related to bp api-microversion-support
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I1939c19664e58e2def684380d64c465dc1cfc132
Compute API version will be transmitted to API side via
X-OpenStack-Nova-API-Version header, if minor part of version is presented.
New module "novaclient.api_versions" was added as storage for all api versions
related functions, classes, variables and etc.
`novaclient.api_versions.APIVersion` class is similar to
`nova.api.openstack.api_version_request.APIVersionRequest`. The main
difference relates to compare methods(method `cmp` is missed from Py3) and
processing "latest" version.
Related to bp api-microversion-support
Change-Id: I0e6574ddaec11fdd053a49adb6b9de9056d0fbac
Having retry_after in HTTP response header for 403 status code caused
client to fail with TypeError exception about unexpected keyword
argument. This is related to bug in nova-api. To prevent this kind of
client problems in the future patch adds check to from_response
function to pass retry-after header only to classes that inherit
from RetryAfterException and regression unit tests.
Change-Id: I6bfc8b33eb591d30b3c647397b11100094718e13
Closes-Bug: 1365251
This reverts commit 3bde9c3f427110dae3480644752f49b79ac66ec5.
This change is a part of a series that is not backwards compatible.
It broke applications using the client library.
Change-Id: Id01a0a0feb601539d3855f445ebaf6a3cc000610
Partial-Bug: #1340596
This reverts commit 4e1ee661083bd672a884fd13fdb1ffaadea5252a.
This change is a part of a series that is not backwards compatible,
and caused breakage in applications that use the client library.
Change-Id: If614826fb0832602110c1ac8be2c0e6324a5a248
Partial-Bug: #1340596
The session object is a cross-client means of standardizing the
transport layer.
Novaclient's HTTPClient object has diverged significantly from other
clients. It is easier to simply replace it if a session is provided. If
a session is provided then users of the library need to be aware that
functions such as authenticate() will no longer have any effect/are in
error because this is no longer managed by nova.
Change-Id: I8f146b878908239d9b6c1c7d6cdc01c7e124f4e5
Since exceptions from oslo is used, ClientException doesn't have any
attributes related to HTTP, so `HttpError` should be set as default
http-based exception.
Also, attribute `code` is used in several project, so it should be
returned and marked as deprecated.
Partial-Bug: #1322183
Change-Id: I3c71e2d25d6e36b5bac0f2b3add74d6747cf7c25
- Remove unused exceptions from novaclient.exceptions
- Reuse exceptions from common code
OpenStack clients which already use exception from common code:
- ironicclient - I784007f36dd6a63fc4c77e0d0f0f000e05eb792f
- keystoneclient - Iedf4e5d753d4278d81751ba0f55fdef3566b56de
- saharaclient
- tuskarclient - Iacbf219168fae62d864c6594dd41e0737e848cfa
Similar patches in other clients related to reusing exceptions
from common code:
- cinderclient - I07f04ba5357e0196fe43b510e1d2fff5afa02faa
- glanceclient - I9838391cff7e450f08d27668564b02e63259186c
Related to blueprint common-client-library-2
Change-Id: Ia35d65d57a0047f88a609070f8b4c76215cbd3e9
When running nova boot --poll, any error states that occur will be
seen but, an exit code of 0 will be returned indicating success.
This would be problematic for scripts looking to see if an
operation completed successfully.
To fix this, an exception is raised after the nova api indicates to the
poll code that the vm is in an error state. The exceptions signals the shell
main function to exit with code 1.
Change-Id: I48f6b1c82e2f8b221dda898dcb804b0196018505
Fixes-Bug: #1292669
If a server error is returned that has an unknown code, novaclient will
end up printing something similar to:
ClientException: <attribute 'message' of 'exceptions.BaseException' objects>
Setting a message for ClientException will ensure that something more
useful than that is printed.
Change-Id: I43a2a33017f9a5c1b79d7fd8af4153e91d296f7b
Closes-bug: 1295293
In python 3, dict.keys() is a class of 'dict_keys', it does not
support indexing.
Cast the dict to list to get the "first" value of dict, which is
compatible with python 2&3.
Closes-Bug: #1229005
Change-Id: I561b7ada9e5ad936659a657b3161a9b93a15a788
currently novaclient recognize 413 as rate limiting status while
it shoule be 429 according to HTTP protocol.
fixes bug 1191874
Change-Id: Ib1ae54f7d13d0ca579dd264e8d0d7630770e92d6
It is expected to recieve a 405 or a 409 from Nova, but novaclient presents
them as a generic ClientException. This patch adds MethodNotAllowed
and Conflict classes to represent these HTTP responses.
Change-Id: If89cee04ebd74daaa28ea30b5c57cdc63edc1551
Fixes Bug 1103557.
novaclient abstracts out http request from user/client
making it unknown to user what root cause behind nova client
exceptions being raised. By including url and method in exception
handling, this allows user to handle accordingly.
Change-Id: I1a509bb932b3fd029bd0870ab699a39e21da19bb
* Implement correct certificate verification
* Add --os-cacert
* Rework tests for requests
Pinned requests module to < 1.0 as 1.0.2 is now current in pipi
as of 17Dec2012.
Blueprint: tls-verify
Change-Id: I9a25a94c8dfcaf483c4c8328439809d65cf10b38
When novaclient gets a Connection Refused it now presents that as a
ConnectionRefused exception with appropriate information rather than as
an HTTP exception. Addresses bug 1047078.
vagrant@precise64:/opt/stack/python-novaclient$ nova image-list
ERROR: ConnectionRefused: '[Errno 111] Connection refused'
Change-Id: Iebf4d78a524004d5e79d2219b35f90fbd38ee690
- Remove the NOVA_RAX_AUTH hack and provide (temporary) compatibility
with the new system.
- Example plugin for RAX and HP provided here :
RAX - https://github.com/emonty/rackspace-auth-openstack
HP - https://github.com/emonty/hpcloud-auth-openstack
- Plugin are allowed to specify their own auth_url directly.
- Thanks to mtaylor for helping on this.
Change-Id: Ie96835be617c6a20d9c3fc3bd1536083aecfdc0b