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>
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
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
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
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
'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
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
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
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
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