In order to pave the way for functional testing, move existing unit
tests into a directory labeled unit. A subsequent patch will add a
directory for functional tests.
Change-Id: I0adb8b9f14451acb382c725d31f5387b4b6d82bb
Adds sorting support to the 'nova list' command.
--sort <key>[:<direction>]
The --sort parameter is comma-separated and is used to specify
one or more sort keys and directions. The direction defaults to
'desc' for each sort key and the user can supply 'asc' to
override.
Partially implements: blueprint nova-pagination
Change-Id: I635e017c7f9ab61812333983bfecccd6fce8d394
This changeset enables support for Keystone V3 authentication
on the Nova CLI. This provides consistency between using
novaclient as the Nova CLI and using it as a library
as the Keystone V3 support already exists for the libary usecase.
The bulk of the change surrounds the use of the keystoneclient
session object for authentication, retriving the service catalog,
and HTTP connection/session management.
Co-Authored-By: Morgan Fainberg <morgan.fainberg@gmail.com>
Change-Id: Iece9f41320a8770176c7eeb5acd86be4d80cc58f
The server rescue call supports passing a password and an image,
however novaclient does not have options to support this. This commit
adds these options and updates the related unit tests to support the
change.
Change-Id: I14c878c0027f8206671ee001ba5195f94f842314
Previously deleting valid/invalid security
group rules was throwing the error of
"AttributeError". With this fix, now both
types of security group rules can be deleted.
Change-Id: I253c2742efe69ee41976c88ca2775189bc5bde0d
Closes-Bug: #1163469
Adds "--user" as a search option to the list command.
Also since seach by tenant or user also needs all_tenants=1 add
this to the seach options automatically instead of making users
remember to add it
Change-Id: Icc828080b400aecdb320b721c569992677848cc6
The description field to the Nova API for secgroup
create is not optional. This enforces the supplying
of the description field in novaclient as the Nova
call will fail if it is not supplied.
v3 version does not need to be updated as it was never
changed.
Change-Id: I6fc823990190b935a8e1214efc8c3ac3a0941abf
Closes-Bug: 1367121
Using the existing server live_migrate api, this new feature,
adds the ability for admins to live-migrate all running instances
from one host to other hosts. The patch implements the feature
for Nova API V2 and API V3.
Co-Authored-By: Cédric Soulas <cedric.soulas@cloudwatt.com>
Change-Id: Ie8dd1b66fb8eaefa6ff38752b1e4f46bab145820
Implements: blueprint host-servers-live-migrate
Instead of listing all servers and doing clientside filtering, use the servers
filtering on name.the server's list already supports filtering
so just pass a search_opts dictionary into list().
This should speed up nova commands when a user has large numbers of servers.
Change-Id: I6deea8523754ff213f43bd059fb00f34fc0e1a12
Closes-Bug: #1202179
Modules `strutils`, `timeutils` and `network_utils` from common code are
graduated in `oslo.utils`, so we can:
1. remove `novaclient.openstack.common.network_utils` and use
`oslo.utils.netutils` instead.
2. use `oslo.utils.encodeutils` and `oslo.utils.strutils` instead of
`novaclient.openstack.common.strutils`.
3. use `oslo.utils.timeutils` instead of
`novaclient.openstack.common.timeutils`.
Additional information:
- modules `importutils`, `strutils` and `timeutils` from
`novaclient.openstack.common` cannot be removed, because:
- importutils is used by apiclient and jsonutils;
- strutils is used by apiclient, cliutils and jsonutils;
- timeutils is used by jsonutils
- additional check for `safe_encode` in Py3 is required, since
If91a866d864a22d28a352152beff4c7406a27b7b was merged.
Change-Id: Ib8d79d9c85af4916e87a76a1a67a13488ddaa111
Add the ability to specify --fields, using any valid vields, when
doing a network-list. This code was shamelessly borrowed from
do_list(). This will allow crafting network-list queries which
mirror the functionality of 'nova-manage network list', which this
query was intended to replace.
Change-Id: I7ec7066350cdb979a64d20d14362b12e3ec76496
Adding nova client functionality to use the auto find
destination host for evacuate.
This change makes the target host optional
on evacuate command.
Partial Implements: blueprint find-host-and-evacuate-instance
Co-Authored-By: Leandro Costantino <leandro.i.costantino@intel.com>
Change-Id: I4e6b52df9c55b223c8693058d73125962cff4d16
Currently, the command delete return a zero if it failed for any
of servers, the return code should be a nonzero.
Change-Id: If7009fdeb5a60fe2e357bcc447313cbdb7b2ff39
Closes-Bug: #1339647
Previously, nova ssh was searching for network types: public and
private, which seems to be incorrect (fixed and floating seems to be
correct), causing that this command has probably never worked.
This commit fixes the above and adds an option for selecting the network
to use, which is helpful when there are more networks for the VM.
Change-Id: I01ea6cee725c0feaacab60975c3792b0ac1305e9
Closes-Bug: #1227694
Closes-Bug: #1343991
Also adds missing network-delete shell command. Additionally changes
the type of vlan and vlan_start to int to match the api samples.
Partially-implements blueprint better-support-for-multiple-networks
Change-Id: I233614431db4737284cceaf8e6b947f50dd84602
As per the bug, description should not be a mandatory parameter
as it creates inconsistency with other opestack items which has
description as an optional parameter.
So in the fix, the description argument has been made optional.
The old command was:
nova secgroup-create <name> <description>
Now new command will be:
nova secgroup-create <name> [<description>]
Patch updated based on the comments received
Updated commit message for gerrit autolink
Closes-Bug: #1332133
Change-Id: I2ded915be4a57f3c46e6cf5d1bf00e8c917cd0b9
This reverts commit 3bde9c3f42.
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
Adding support specifying multiple servers to nova reset-state in
a single invocation.
Change-Id: I7add0c26b0e59b31751de7a60ebdde3f568b3354
Closes-Bug: #1314217
Allow to specify vlan tag when create nova network, the dest of vlan
option should be 'vlan' instead of 'vlan_start'.
Provide new option 'vlan_start' when create nova network.
Change-Id: Idfaf58d4eee4d9bbf6bba5e0b6c9dbf82236694d
Closes-bug: #1329599
Previously, the endpoints command just returned the first endpoint. This
was not very useful; people expected to see the endpoints in the region
they specified. This patch does the following:
- If there's only one endpoint, use that.
- If there's a specific one for your region, use that.
- If there isn't, warn, and show the other ones.
Closes-Bug: #1256009
Change-Id: I70b82bdffb9b2e3da415a3bb941bcff287e39789
Currently, nova rebuild only support reset: password, image,
preserve-ephemeral. While nova api support other parameters
like: name, metadata, personality. This patch adds these missing
parameters for server rebuild.
Change-Id: I4edd8146bbbb0b2e0c9e01907af5dab96f090029
Closes-bug: 1268435
The current code in novaclient/base.py, class BootingManagerWithFind
do not take in account the differences required to boot an instance from
a volume in API v3. V3 expects UUID as volume id and also the source type
to be set.
Change-Id: Id8cfb2d7811aead27cb26cf7ff615c7a9ed05d54
Close-bug: 1325303
The quota-class-update command wasn't allowing updating quotas for
fixed_ips which is a supported key for the os-quota-class-sets API.
This change adds the support to update qoutas for fixed_ips and updates
the existing test to be more robust in (a) the quota keys it's testing
and (b) the request body it's asserting.
This is a v2-only change since the os-quota-class-sets API was removed
from the nova v3 API in Icehouse.
Closes-Bug: #1330571
Change-Id: Ifcca6d00551619b993b96f05134980a4ca2f2acf
The Nova server will restrict unprivileged user accounts to just
public images, while allowing administrator accounts access to
all. The Nova client shouldn't force the flavor name lookup to
be restricted to just public images, since that breaks the ability
to the flavor name when booting an instance
Fixes bug #1327212
Change-Id: I949aec52660242249b8cba51d77bfdc1acaf31d2
Fix:
Intially the cli was raising "CommadError" in case the requested
flavor or image were not present.
This error category was not approrpiate as it signifies an error
in the command syntax. When the requested resource (flavour/image)
does not exist, a ResourceNotFound error should be raised. So,
added a new error category "ResourceNotFound" to cater for this
scenario and updated the code to raise this new error.
"nova show <instance_name>" command has also been updated to raise
"ResourceNotFound" error when the requested vm for which details
have to be displayed does not exist.
Closes-Bug: #1258488
Change-Id: If64a087944586ef5792efe3baa62e455b9bbaa07