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
all references to `root password` have been changed to `admin password`
but the `root-password` command remained. This changes it to
`set-password` which is less ambiguous and consistent with existing
commands `clear-password` and `get-password`
Change-Id: I8683e4ecd4d9294989eb3d8d27d1fb75c16b261b
This bug was occurred in cell mode.
In cell mode, compute node's id was not identified by integer type. It
was formatted with "path!to!cell@ID".
Therefore we can't using the id of hypervisor-list output.
For example,
> nova hypervisor-list
+----------------+--------------------------+-------+---------+
| ID | Hypervisor hostname | State | Status |
+----------------+--------------------------+-------+---------+
| region!child@1 | vagrant-ubuntu-trusty-64 | up | enabled |
+----------------+--------------------------+-------+---------+
Change-Id: Iba0cc1993f67351b11d034f372d7a5b98dc017f0
Closes-Bug: 1475973
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
Issue found with mock 1.1.3:
Because of the test inheritance test_keypair_import is getting called
3 times. It appears that the mock for open builtins is getting torn
down after it's first use, and not correctly built again on subsequent calls.
In the gate, this is a race, because we have 3 tests and 8 workers,
and this will only fail if 2 or more of the tests happen to be
allocated to the same worker. This can be reproduced locally with:
tox -e py27 -- --concurrency=1
Converting this to the context manager usage of mock appears to
resolve the issue.
Co-Authored-By: Sean Dague <sean@dague.net>
Related-Bug: https://github.com/testing-cabal/mock/issues/280
Change-Id: I9a87375d2eb6c7cf7b9124b2095a5a4bcc8e7bf3
Current hypervisor-show <hostname> command does not properly list
when there is a long list of cpu info feature. The long list of
cpu info feature has comma-separated values.
Because of this user is not able to read the print out properly.
print_dict() has been changed to show a list with comma-separated
values properly.
Change-Id: Icc53439cecd3b5eee2340267a0447ce209d7b653
Closes-Bug: #1466435
Most places resolve id of input parameter as 'base.getid'
and in the beginning of _boot function it resolves image id
with such method. But in fixed place it tries to get id directly
from object. But code that uses novaclient directly(without shell)
falls in this place because it passes string with id to image parameter.
Change-Id: Ib90e4ffa3b7835f6648a62eddf7f7b87b5ab0f7e
Changes include:
e782594 Add last_request_id only if it is not none
18bf5ca Fix usage of NotFound exception in apiclient.base
3bc8231 deprecate apiclient package
Depends-On: Ia83ef6136da1c551ea947679dc546a0d7ad2f876
Change-Id: I0b5917c657d6adc3d34229b14833a5224c168e07
This reverts commit 02328d33373479b33f4fee8112d47c1ae29e8bd4.
As per the comments on the support all-tenants in floatingips-list
spec [1], this patch reverts the --all-tenants flag from
python-novaclient since support has been reverted out of Nova more
than a year ago.
[1] https://review.openstack.org/#/c/171389/
Change-Id: I2d6566ecf59d307e3ea117b3b20dc918c758b63e
On my production system, when using client version 3, an exception is
raised with an incomplete message as the installed novaclient is
failing to find the bundled client versions. This commit creates a new
_get_available_client_versions() method and moves the client version
searching from get_client_class() into it.
We also update __get_available_client_versions() to pass
pkgutil.iter_modules the full path to novaclient rather than
'novaclient', which is what actually resolves the issue here.
Lastly, we add a single test to ensure that
__get_available_client_versions() does not return an empty list.
Change-Id: I07ce414863e833c72e50ad8cf1824054cfb41457
Closes-Bug: #1463809
The client.keyring_saver attribute was not being reliably set so the
client._save_keys function was not storing any new tokens in the
keyring.
Add a unit test to ensure keyring_saver is being property set.
Closes-Bug: #1397732
Change-Id: If0df24c819d71b4df302309d049079a867a11c76
You can set admin password as
nova boot --image <image> --flavor <flavor> --admin-pass <pass> vm-name
Change-Id: I119aba428c15d736e64d990be47cc5c13bb83738
Closes-Bug: #1248517
This is an old carry over from pre-testtools days and has a nose import.
Nothing is using it so remove it.
Closes-Bug: #1458272
Change-Id: I01b5d35d2e2aec161bd3dbaecb4670ddf3ee8794
This deprecates all of the volume CLIs/APIs that go directly to the
cinder API via the volume service type.
This will emit a warning each time a deprecated CLI/API is used and also
updates the help docs for the deprecated CLIs and docstrings for APIs.
The plan is to do a release once this is merged so people start seeing
it and then we'll actually remove the deprecated CLIs/APIs in the first
python-novaclient release after the Nova server 2016.1 'M' release.
DocImpact: The volume, volume-type and volume-snapshot CRUD CLIs/APIs are
deprecated and will be removed after the Nova 2016.1 release.
Use python-cinderclient or openstackclient for CLIs instead.
Use python-cinderclient or python-openstacksdk for APIs instead.
Related-Bug: #1454369
Change-Id: I4e92f924739de9b664e08117984bfb60359f2212
Update the calls to pkg_resources to avoid forcing a requirements check
when the plugins are being loaded.
There are 2 versions of the entry point API in different releases of
setuptools. In one version, the require keyword argument can be passed
to load(). In the other, separate methods resolve() and require() need
to be used. This change updates the mock and fake objects to support
either, since the fakes are subclasses of the EntryPoint class in
pkg_resources.
It would be better to replace the calls to pkg_resources with stevedore,
which provides a more stable API, abstracts away this difference, and
provides an API for creating test managers directly. That change would
have required more extensive updates to the test suite, though, and
since I'm not as familiar with this code base as others will be, I will
leave those changes for someone else.
Change-Id: I2a9aeb53ccad04c7fa687f25340306b84218f9ff
Partial-bug: #1457100
The novaclient tests are rife with examples of using a list comprehension
to perform a series of asserts, when a simple for loop would be more
appropriate and more idiomatic; part of the problem is the propensity
for people to cut and paste. Eliminating the existing examples should
remove the temptation for developers to use this non-idiom to perform
tests.
Change-Id: I2cc8979e720740eae81692a60e30a3d95dce2a2c
Supporting 'all_projects' in server-group-list so that
admin users can list other tenant's server groups.
Change-Id: Ie50288464ebc6585590a1a74efa8804584771ebc
Closes-Bug: #1454523
Heat uses `novaclient.shell.OpenStackComputeShell._discover_extensions`
function, which is private currently. It's better to change this method
to public for public use.
Change-Id: I15879d56db2ec88a9bef99b6af8924ebd4ad169b
Closes-bug: #1440779
Added new subcommand "limits" which displays absolute limits and
rate limits both. do_limits() functions calls get() only once and
then passes limits.rate and limits.absolute to _print_rate_limits
and _print_absolute_limits respectively; these functions then
format the output.
Change-Id: I1344da1a3925a3f3a757e340f11381b69a668bf7
Closes-Bug: #1172254
The endpoint of version API doesn't contain "/v2/{project-id}" and it is
just "/". SessionClient is based on the endpoint "/v2/{project-id}/...",
so this patch makes a client use a raw url for version-list API.
Change-Id: I53f2afacce2dda14ac9761e824b48887f7c192f9
Closes-Bug: #1444235
Module novaclient.v1_1 is already deprecated, so it's time to stop using it
inside novaclient.
Since support of v3 nova is undocumented feature, which uses v2
implementation, we can remove code related to it.
Also, this patch removes redundant check for compute api version != 1.0.
Change-Id: I06b349f704d5ae2c592d8d286da268870f2a69e9
The FloatingIP repr added in d614dbcab9cc8c5732ce28c655738218e147aad7
is incorrect, and can cause fails when you attempt to do bulk creation
activities with logging turned on.
This removes the __repr__ for FloatingIP so that it fails back to the
Resource defaults which are safe.
Partial Revert of d614dbcab9cc8c5732ce28c655738218e147aad7
Closes-Bug: #1437244
Change-Id: I8cedf418917157ce632606bef640049140134372
Change https://review.openstack.org/#/c/164321 broke the bypass_url
option. It made the assumption that self.service_catalog won't be set
in novaclient/client.py when bypass_url is specified, which isn't
necessarily true. This change adds a check for self.bypass_url and
looks up service url only if bypass_url hasn't been specified.
Closes-Bug: #1445086
Change-Id: I72d2b3e3199aeae7fb2f2c68be259774e07a4501
This reverts commit 4e79285b45ec1490c8e923f724cbaf4d42fe81c4.
The aforementioned commit broke flavor-show for mixed case flavorids.
The reason is a bit complex. On the nova api side, there is caching of
db items for flavors, keyed off the flavorid retrieved from the db,
case sensitive, unlike the db query itself. Attempts to flavor-show
a flavor with flavorid composed of letters will fail with a 400 if
the capitalization doesn't match.
For the flavor names, they work in lowercase because the find_resource
function falls back on a search by "human_id" after failing every other
attempt to find the flavor, because "human_id" is a oslo-slugified
string (all lowercase, non-word characters removed, spaces converted
to hyphens).
Closes-Bug: #1446850
Change-Id: I73247b50f5a6918167c071ccc13cd676aa2c7fec
The eph_dict expects the format size=value.Catch valueError and return
proper error text
Change-Id: I99ef7efe7dc14aa346913009e244ad4eea0369a9
Closes-bug: #1433200
Since then an instance was booted with a flavor, the flavor could be
deleted or become unavailable (private flavors). As a result novaclient
fails to show the instance with member role user.
This patch set adds handling of unavailable flavors to showing of
instances as it is done for unavailable images.
Closes-Bug: #1366168
Change-Id: I810dcac814b7523313112bb9151754659b85df51
The current code in the servers api assumes only text files will be
provided as userdata. That is, the data is utf-8 encoded before it
is base64 encoded and sent. This breaks for binary userdata files,
(example, gzip files) as they can't be utf-8 encoded.
This change ignores specifically the exceptions that are raised
when utf-8 encoding is attempted on non-text data: AttributeError
and UnicodeDecodeError. These exceptions will be ignored to let
binary files proceed to the base64 encoding step.
Closes-Bug: #1419859
Change-Id: Ie96283f6ff892ae30485722cf7c3ec40f3f1b5df
Currently, the all_tenants=1 search option is being passed all the
time for 'nova delete' commands in order to enable 'nova delete' by
name to work across tenants, for those that have all_tenants access
in the nova policy.json. This however breaks all 'nova delete' for
non-admins when policy has been configured to allow only admin to
list servers across all_tenants.
This patch changes 'nova delete' to take an option --all-tenants to
get the functionality to delete by name across tenants. This is
similar to how 'nova list --all-tenants' works.
Closes-Bug: #1439381
Change-Id: I204daaf5c0f4dab7c93ef0bd85ffab3529ca352a
nova rate-limit returns absolute limits too, but novaclient does
not show absolute limit,a bug
(https://bugs.launchpad.net/python-novaclient/+bug/1172254) has
been filed for this one. There is no test which assert on both
absolute and rate limit. This patch assert on both the rate and
absolute limit returned
Change-Id: Ia635f32eefc46e22e3f4e45a7885f492bb967a99
Closes-Bug: #1436653
While creating floting ip range returned by API object doesn't contains
attribute 'address', but repr tries to get it. So change list to return
objects of FloatingIP and add repr to FloatingIP,
also changed repr of FloatingIpRange to return actual range of addresses
Closes-bug: #1437244
Change-Id: Ia9e30a3f3d82fa8dde113b40d2da372bf1e7a086