Commit Graph

13 Commits

Author SHA1 Message Date
Takashi Natsume 7ef2c28bf3 Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I4d45ae17f6f84f945f5dd049a929216ce6b6b58e
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2020-04-26 10:12:09 +00:00
Takashi NATSUME 80b4286981 Replace MB with MiB
Change-Id: Ie5bd325d8e0f7e9af76c1ddae1d679b0e797c84b
2018-10-22 07:11:25 +00:00
Matt Riedemann 4f78a4217c Add support for microversion 2.55 - flavor description
This adds the support for microversion 2.55 which allows creating
a flavor with a description, showing the description in flavor details,
and updating the description on an existing flavor. Related python API
bindings are added, and the new "nova flavor-update <description>" CLI
is added.

Implements blueprint flavor-description

Change-Id: I0a09c0a63d2e91ef5aa31a8e43e28f8745faae14
2017-11-22 09:15:54 -05:00
int32bit b7edc92d81 Add min-disk and min-ram filters to list flavors
The Nova API allows user filter flavors by minDisk and minRam,
but that is not implemented in the current novaclient yet.
This patch introduce '--min-disk' and '--min-ram' options to support
it. In addition, We also append '--sort-key' and '--sort-dir' to
the flavor-list subcommand to support sort the result list.

Change-Id: I3849cc2d73057170dc224fa86b724f5141ca9a23
Closes-Bug: #1647867
2016-12-08 03:30:06 +00:00
Andrey Kurilin 65c1fbae70 Store api_version object in one place
Currently we store api_version in two places: client and
HTTPClient/SessionClient instances.

It would be nice to store it in one place, so it would be easier
to change api_version without recreating novaclient object.

Change-Id: I36369a126c20de5922141e8725834ca93d6b0a1a
2016-08-18 18:36:40 +03:00
Takashi NATSUME f194a5abad Add return-request-id-to-caller function(2/5)
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
2016-01-27 02:45:22 +00:00
liyingjun 986ed2ae0b Add sort_dir/key to flavor list
'marker' and 'limit' are already added to flavor list, but 'sort_key'
and 'sort_dir' which are useful for pagination are missing.

Closes-bug: #1505939
Change-Id: Id78595f15fbb289133092a32238238e3c4a9d0a0
2015-10-15 08:33:38 +08:00
Pete Savage bde241b947 Added marker functionality to flavours and images
Markers to support pagination was missing from flavours
and from images.

Change-Id: I27de83f18a4850b63020ac60e010839a13e916fb
2015-06-26 11:05:10 +01:00
melanie witt 098116d6a5 Revert "nova flavor-show command is inconsistent"
This reverts commit 4e79285b45.

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
2015-04-21 22:19:06 +00:00
Jenkins 3db98546cf Merge "nova flavor-show command is inconsistent" 2015-03-11 20:14:17 +00:00
Abhishek Talwar 4e79285b45 nova flavor-show command is inconsistent
The nova flavor-show command accepts a flavor
name as its parameter. The command show inconsistency
as it works with the exact flavor name and flavor name
in all lowercase but fails for any other case pattern.

So, updated the code so that if we run the command
with flavor-name case patern it runs fine.

Closes-Bug: #1423885
Change-Id: I713bf2b5aca977df40dc745e29d4fe98a950c991
2015-03-11 09:52:44 +05:30
Pavel Kholkin 560eeafb6d Cleanup in asserts in python-novaclient
The following replacements were done:

1) assertEqual(True, *) -> assertTrue(*)
2) assertEqual(False, *) -> assertFalse(*)
3) assertTrue(a in b) -> assertIn(a, b)
4) assertTrue(* is not None) -> assertIsNotNone(*)

TrivialFix

Change-Id: I8d8a2d7b5d3505e07728544b683b301d1a8850cf
2015-03-03 15:36:49 +03:00
Andrey Kurilin 0a60aae852 Rename v1_1 to v2
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
2015-02-04 17:40:46 +02:00