Instead of using assertEqual(None, ***), developers should
use assertIsNone(***).
Change-Id: I55e9161a4df9197546603385228ea85528de43a7
Closes-Bug: #1510006
It's a resource-consuming task to implement full-flow (up to getting
and reading a dump file) functional test for trigger-crash-dump.
We need to upload Ubuntu image for booting an instance based on it,
and to install kdump with its further configuring on this instance.
Here, the "light" version of functional test is proposed.
It's based on knowledge that trigger-crash-dump uses a NMI injection,
and when the 'trigger-crash-dump' operation is executed,
instance's kernel receives the MNI signal, and an appropriate
message will appear in the instance's log.
Wait_for_server_os_boot() method has been added to ClientTestBase
to check if instance's operating system is completely booted.
The _create_server() method has been removed since the change
which puts this method to the base test class has been merged.
Change-Id: I2313c5d37a7cf87a8d75e37c93aab136cf028ec1
Several OS projects(cinder, neutron, osc...) use
`novaclient.discover_extensions` for initialization novaclient.client.Client
with novaclient.v2.contrib extensions. In this case, it would be nice to
provide a way to not discover extension via python path an entry-point.
Change-Id: I030f4c55c2795c7f7973f5f12e54b9819c4a5578
Closes-Bug: #1509500
2.20 - From this version of the API user can call detach and attach volumes
for instances which are in shelved and shelved_offloaded state.
This change changes only server-side checks.
Change-Id: I15a988c730d2fb0be4416dc79b63d357ae990ff7
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
Currently the tests just attach instances to the first network returned
by "net-list". That might however not be the right thing in some
environments. This change allows to override the default network via the
environment variable "OS_NOVACLIENT_NETWORK". If not specified the
test will fallback to the old behaviour and just use the first network.
Closes-Bug: #1510975
Change-Id: Ie682111127584a33d8e96377d812d3a6352c760d
Currently, users must use different interface to get request_ids.
1. Commonly, ListWithMeta, DictWithMeta or TupleWithMeta, etc is
returned to user. And request_ids is returned as an attribute of
*WithMeta.
For a server delete action:
result = serverManager.delete(server)
# result = TupelWithMeta
request_ids = result.request_ids
2. Some places reutrn a tuple which contains request_ids in one of
its elements.
For a server stop action:
result = serverManager.stop(server)
# result = (Response, TupleWithMeta)
request_ids = result[1].request_ids
Such kind of difference makes user confused.
This change provides a backwards compatibility solution for users
who don't care about request_ids as TupleWithMeta is subclass of
tuple.
Change-Id: I164bb95abce6dc96cf455033f02822ccb0d87b8f
Closes-Bug: 1542179
2.18 - Establishes a set of routes that makes project_id an optional
construct in v2.1.
The change on Nova-API side adds only check for existence of
"project_id" at the url. It doesn't check microversion, so all latest
and previous microversions can work with or without project_id.
Proof: all functional tests are succeed on this change (several of them
use latest microversion).
To cut down "project_id" from the url at the novaclient side, we need to
modify ``novaclient.client.HttpClient`` and
``novaclient.client.SessionClient``. This change requires splitting
Nova's related requests and the others(authentication, volume...), which
are still require "project_id" at the url.
It is a complex task, which can be skipped for now to unblock
implementation of further microversions.
Change-Id: Ia6e608aac41d2f2d59b9504d21647e4f88af3335
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
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.
* novaclient/v2/volume_snapshots.py
* novaclient/v2/volumes.py
* novaclient/v2/volume_types.py
Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I4de8c5cf685a5970acc92f8a58a1db26a8d9ffc7
Implements: blueprint return-request-id-to-caller
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.
* novaclient/v2/contrib/assisted_volume_snapshots.py
* novaclient/v2/contrib/baremetal.py
* novaclient/v2/contrib/cells.py
* novaclient/v2/contrib/instance_action.py
* novaclient/v2/contrib/list_extensions.py
* novaclient/v2/contrib/migrations.py
* novaclient/v2/contrib/server_external_events.py
* novaclient/v2/contrib/tenant_networks.py
Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I58ec61eb585d145cb7d638bcb690b3ebee0461e9
Implements: blueprint return-request-id-to-caller
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.
* novaclient/v2/keypairs.py
* novaclient/v2/limits.py
* novaclient/v2/networks.py
* novaclient/v2/quota_classes.py
* novaclient/v2/quotas.py
* novaclient/v2/security_group_default_rules.py
* novaclient/v2/security_group_rules.py
* novaclient/v2/security_groups.py
* novaclient/v2/server_groups.py
* novaclient/v2/services.py
* novaclient/v2/usage.py
* novaclient/v2/versions.py
Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I9203f70a0eef5686b590fbff35563f2cf8b6f586
Implements: blueprint return-request-id-to-caller
Bug_description:
Today, in order to specify networking arguments, the nova client
only accept uuid's. It would be nice if we could extend the
client option to allow names to be accepted too.
Solution:
This patch supports provisioning of VM by mentioning network name.
_boot method currently validates for network ID to boot a VM.
Updates:
* new parameter 'net-name' is added
* when 'net-name' is specified network ID is retrieved
* network ID is used for further processing of vm boot request
* if multiple networks with the same name exist then
NoUniqueMatch exception is raised
* help text is updated
DocImpact
Closes-Bug: #1496180
Co-Authored-By: Pavel Kholkin <pkholkin@mirantis.com>
Change-Id: Ifb14a76749901ee106cdb807e38820a2c25e1320
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.
* novaclient/v2/agents.py
* novaclient/v2/aggregates.py
* novaclient/v2/availability_zones.py
* novaclient/v2/certs.py
* novaclient/v2/cloudpipe.py
* novaclient/v2/fixed_ips.py
* novaclient/v2/flavor_access.py
* novaclient/v2/flavors.py
* novaclient/v2/floating_ip_dns.py
* novaclient/v2/floating_ip_pools.py
* novaclient/v2/floating_ips_bulk.py
* novaclient/v2/floating_ips.py
* novaclient/v2/fping.py
* novaclient/v2/hosts.py
* novaclient/v2/hypervisors.py
* novaclient/v2/images.py
Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: Ic624d532f1a468dd45105bbb5aa6d8a730984338
Implements: blueprint return-request-id-to-caller
Add return-request-id-to-caller function to
'Server' resource and 'ServerManager'.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.
* novaclient/v2/servers.py
Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I8c2d3abcebba7823f42e2f27356e73bc6d7ade42
Implements: blueprint return-request-id-to-caller
Added wrapper classes which are inherited from base data types str,
list, tuple and dict. Each of these wrapper classes and
the Resource class contain a 'request_ids' attribute
which is populated with a 'x-compute-request-id' or
a 'x-openstack-request-id' received in a header from a response body.
This change is required to return 'request_id' from
client to log request_id mappings of cross projects.
This patch is one of a series of patches for implementing
return-request-id-to-caller.
Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I422c4f4ee59991ca89a0a16f548b537c8b61bb97
Implements: blueprint return-request-id-to-caller
Description of microversion:
Add a new API for triggering crash dump in an instance. Different operation
systems in instance may need different configurations to trigger crash dump.
Note:
- it is hard to write a functional test for this microversion, since it
requires instance in error state
- all possible failed responses already covered by novaclient.exceptions
Nova's change: I6ed777ff637254b4b79417008f9055dd19fc7405
Change-Id: If03b1864bbe7074c720b946fc2700bd5d07debc3
when we try to restore an instance, it's already deleted state,
so we need to add 'delete=True' as default to restore command,
otherwise, the search function can't find the instance
whose state is deleted with the given name
Change-Id: I81cdc46897d76333452069a691824264ad504518
Closes-Bug: 1534644
Shell was not extended in original patch[1], which turned on v2.12, since
there was not any support of vif in shell yet.
Since shell entry point for legacy vif was merged[2], we need to add support
for v2.12 in shell too.
[1] - I18cf23847d3b2b01f5a6ffae2ebc4bede54babce
[2] - Ib3078125beb7beaa08a3408486db54e0d10763e6
Change-Id: Ie38d099b2babfd8424c7d15bd3dfe8bd75e51136
Added support for new host_status attribute in endpoints
servers/detail and servers/{server_id}.
Partially implements blueprint get-valid-server-state
Change-Id: If72fbcaa02267077dc082a7557c593f35474c4bb
The added tests check functionality of os-services actions
except 'service-delete' (it's hard to recover after test running)
Also 'forced_down' attribute exposed by microversion 2.11
is checked here
Change-Id: I6652bac4ce49d5174592f19b1b4d91ac5bd51500
The added tests check granting access actions for public and
non-public flavors
The test for microversion 2.7 checks that the appropriate
error is returned when attempting to grant an access
to a public flavor for the given tenant
The base TenantTest class has been added to avoid code
duplication in test_keypairs and test_flavor_access tests
Also, test_keypairs code has been modified in accordance with
TenantTestBase class usage
Change-Id: Icf21d8aceaa191aee8b8ffc7c52e97ebe9509b3d
It would be nice to check not only unit test on py3 env, but functional
tests too.
Also, this patch fixes usage of xrange in functional tests.
Change-Id: I15ef204022583a40a02b3f2a48771347ddc95f3e
With I3f156d5e5df4d9642bb4b0ffac30a6288459ce61 nova introduced
microversion 2.15 which adds two new policies soft-affinty and
soft-anti-affinity for the server-group api.
This patch bumps the nova client microversion support to 2.15.
The novaclient is transparent regarding the policy value of the
server-group api so no further changes are needed. However the
help text of the policies parameter mentioned the possible policies.
This was removed as the current framework does not support providing
different help text for a parameter depending on the microversion.
Implements: blueprint soft-affinity-for-server-group
Change-Id: I739ed1dd3e4c15e28a269c4f980a12a74fb1def0
Problem:
When we run nova client unit test, there are lots of UserWarnings
printed on the screen. These warnings mean to remind users not to
use v2.client directly.
Solution:
1. In top level tests such as some tests in test_auth_plugins.py
test_client.py and fixture_data/client.py, we use updated usage
novaclient.client instead of using novaclient.v2.client directly.
2. In v2 unit tests, we clean those warnings with setting direct_use
False.
Change-Id: I70682e54874860f1d67d29325811c9da616bb705
Closes-Bug: #1532711
We have had deprecated command line options in novaclient for a long
time, but no warnings about the deprecations were ever emitted, despite
the help text being suppressed. It would be nice to finally get rid of
those deprecated options. This change sets up the precondition to
accomplish this, by emitting appropriate warnings when a deprecated
option is used.
Note: The "use" text for the deprecated options has been deliberately
chosen to reduce the number of translations required.
Change-Id: Ibe13faa56c5abca97f85f9c5172ef5a5591b5f71
assertTrue(isinstance(A, B)) or assertEqual(type(A), B) in tests
should be replaced by assertIsInstance(A, B) provided by testtools.
Change-Id: Ie4fe7b40e3f4350db94b350395269340ee6acf11
Related-bug: #1268480