Module novaclient.v1_1 is used as implementation of V1.1, V2 and V3.
Since future development(microversioning) will be done across V2,
implementation should be done in appropriate module(to prevent misleading).
Despite the fact that implementation for all versions are equal, discover
method for contrib path worked only for v1.1. This patch fixes this bug and
modifies shell tests to check all versions.
Change-Id: Ib6798f4dfe177586302141f522dc593560ce6a5b
The docstrings refer to instance passwords as the admin password, root
password, or simply as "password". That makes documentation difficult to
understand. I've cleaned things up where appropriate.
I did not change the 'root-password' command in this patch, im planning
to do that in a separate patch.
Cleaning that up to have everything
refer to the instance password as "admin password" for clarity.
Change-Id: I421edcaf18bf8536d5e43f71db6e868868154be3
Binary files cannot be treated as utf-8 byte streams and converted
to plain. Change this back to just using base64 encoding as it was
before commit 8b264fc61d.
Change-Id: I4ef6142676022b2e2f3178e7bfa24ed985fcae2c
Closes-Bug: #1408088
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
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
Module gettextutils from oslo-incubator was graduated to separate
library (oslo.i18n) and removed from repository, so we should use
new library.
Change-Id: I15d36ac5a2bb88b332ffa38d29488b75c55a20a9
Make clear the parameter name is "metadata", not "meta" -- this is
confusing at the moment as some other functions do use just "meta" as
their metadata argument.
Change-Id: I2b3ab478e5ad6e885e88bf0471502c9c971e46bd
Misspelling of "coerce" found in the docstring body
of method _boot from class ServerManager. Misspellings
of "project" and "unencrypts" found in docstrings
of client.py and crypto.py.
Change-Id: I052c321f3ad5e13aa57a559e2f28ec5eec32a9b4
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
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
* E265 block comment should start with '# '
* H302 import only modules
Do not check docs/source/conf.py. The file is imported from the
cookiecutter template.
Documented why checks are ignored and if they should be enabled
in the future.
Change-Id: I367064ecaa6d1fd9d918f7ce003303e2db660647
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 return from a base64.encode in python 3 is bytes. Bytes cannot be
json.dumps() so when we base64 encode some data we need to convert it
to a string before passing it through to the request layer.
This isn't shown by unit tests because the fakeclient mocking layer
intercepts the request before it gets to the json encoding code.
Closes-Bug: #1323450
Change-Id: Ibbbb24f64c17069178e3bf0ee9998b806bc629ff
The "config_drive" boot parameter only accepts a Boolean parameter, but
the documentation says otherwise.
Change-Id: I7cbf5aefbd006d8b5425cd8592bacb5d8435b3c9
Closes-Bug: #1314395
servers.Server represents various object now, and some of them may
don't have attribute 'name', for example, the interface_list() result
object. It will cause AttributeError when we try to format string with
such object, so I add a check for the 'name' attribute in __repr__
method, it will use 'unknown-name' instead when 'name' is not found.
Change-Id: If4757d5d73721774543d58a4cc875710a6013f34
Closes-Bug: #1280453
When nova uses neutron, IPv6 addresses may be allocated. This ensures
those addresses are supported.the patch to modify nova is
https://review.openstack.org/#/c/74252/
Change-Id: I2468d3bcaca9122e5d3f9c98044d57f623630dc3
Closes-bug: #1267685
Module py3kcompat was removed from oslo-incubator. We need remove its
usage in client side firstly. This make us move smoothly when sync
oslo-incubator code.
Change-Id: I8b07c32c9852e747579a23685f3c8a07ac13ec01
Partial-Bug: #1280033
Hyper-V employs RDP to access virtual machine consoles, unlike most
other hypervisors which support VNC.
In order to support this scenario, the get_rdp_console API has been
added to Nova. This commit adds the corresponding client side feature,
implemented in a way consistent with existing VNC and SPICE console
support.
Nova Gerrit commit: https://review.openstack.org/#/c/43502/
Change-Id: I86b814797d234f1eb49a7fa67ed27a9bcda034ae
Implements: blueprint hyper-v-rdp-console
Creates an images client when attached to the the servers
client. This is necessary because the Nova V3 API no longer
proxies image queries to glance but when preparing a request to
boot a server it is necessary to retreive information about
images so we need to talk to both Nova and Glance in the same
command.
This is a bit ugly, but not much more than the already existing
ugliness of using the client class designed to talk to
Nova to talk to Glance and Cinder. The long term clean solution
is probably to a unified client that is designed to talk to
multiple openstack services.
Differences between the V2 and V3 API are described here:
https://wiki.openstack.org/wiki/NovaAPIv2tov3
Partially implements blueprint v3-api
Change-Id: Ib43682f38cd7a3e0f910b75e96685591246e7f67
This new extension permits preserving the ephemeral partition if the
Nova hypervisor supports that. This is primarily useful when Cinder is
not available to provide preservation of state while replacing the
image in use. One common situation for that is Nova Baremetal.
DocImpact
Blueprint: baremetal-preserve-ephemeral
Partial-Bug: #1174154
Co-Authored-By: Robert Collins <rbtcollins@hp.com>
Change-Id: Ib1511653904d4f95ab03fb471669175127004582
Something like this:
1. Modify "`Image` to add metadata to" to ""`Image` to delete metadata" on
delete_meta()
2. Modify "The security group to delete" to "The security group to update"
on update()
3. Remove the "password" from the description on update()
Change-Id: I0120d84cc263d4eb58b692a5eb6f20ca0ef8264d
Closes-Bug: #1258461
This patch allows users to retrieve VM encrypted passwords using the
`nova get-password` command without specifying the private key.
Change-Id: I13ea132160dca912c6c1643b1006377982b778a1
Implements: blueprint retrieve-ciphered-vm-password
In Python 3.3, hash randomization is enabled by default. It causes the
iteration order of dicts and sets to be unpredictable and differ across
Python runs.
In the test case, the fixed expecting string will not match the test
result, it is relying on the dict order.
This change transforms the input dict to a sequence of two-element list,
with fixed order, and update the related expecitng string in test case.
Close-Bug #1234438
Change-Id: Ic7846279a9f508a856cd4ee70408d537088792f2
The "shelve" API, which powers off and snapshots a vm instance, has been
implemented by Nova-server side.
In addition, thare are two relational API "unshelve" and "shelveOffload".
This patch adds three commands for using these APIs.
Fixes bug #1231827
Change-Id: Ic2ad1bb537efb40a3155e9f3c7b63e09e82be7f1
Add new arguments and syntax for booting from a block device mapping
that use the new os-block-device-mapping-v2-boot extension. These
allow to:
* boot from an image, volume or snapshot (--image, --boot-volume, --snapshot)
* attach any type of block device (--block-device).
* attach an swap disk on boot (--swap).
* attach an ephemeral disk on boot (--ephemeral).
blueprint: improve-block-device-handling
DocImpact
Change-Id: I1aadeafed82b3bd1febcf0d1c3e64b258d6abeda
Bug 1209242
nova-api has supported pagination for long. A marker and limit
option could be passed to nova-api to get a slice of instances.
It makes sense to enable this feature in novaclient, so that
horizon could use it for pagination supporting. Modification to
shell.py would be submitted in a separate patch.
Further change will also pass 'sort_key' and 'sort_dir' to
nova-api, as long as nova supports this.
This is part of blueprint support-pagination-for-instance-list
Change-Id: Ieb5f2c1eb31b9f7e95b62b51ea7dc338e3970d04
This is already available in nova but not exposed via client.
* novaclient/v1_1/servers.py:
New interface to list security groups of an instance.
* novaclient/v1_1/shell.py:
New sub command list-secgroup.
* novaclient/tests/v1_1/fakes.py,
novaclient/tests/v1_1/test_servers.py,
novaclient/tests/v1_1/test_shell.py:
Add corresponding tests.
Implements: blueprint servers-list-secgroup
Change-Id: I505bcffdbb15b84bfd73cae5ef5a8fb9c69bd7b9
Python3 reorganized the standard library and moved several functions
to different modules. Six provides a consistent interface
to them through the fake six.moves module.
However, the urlparse, urllib2, etc modules have been combined
into one module which Six does not support so we do it via
py3kcompat.
Modules such as StringIO and CStringIO have been removed
completely so we use the io module.
Change-Id: I53adac11b634de2c710fc39def36bcec96366710
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Allow servers to be created, resized, and rebuilt with the disk_config
option:
http://api.openstack.org/api-ref.html#ext-os-disk-config
There is a separate extension that exists for disk config already, but
it only works via the novaclient CLI interface, not via programmatic use
of python-novaclient as a library.
assert changes in tests/v1_1/fakes allow for other data in rebuild
and resize requests.
Change-Id: I8051ffb8747cf5c67b0199d22fbbe80306b01499
This class was forked from novaclient.base when adding v1.1 support and
and because v1.0 is no longer supported it can be merged again.
blueprint: improve-block-device-handling
Change-Id: I3113eff522a9dc280f48053001afa9e1a0cad3e3
Bug 1195670
Nova supports force_delete or restore instance in the API level,
thus it makes sense to support this feature in novaclient.
Change-Id: I7cc3d2d2a7ab8dfe043176a3ea97c10deae683c9