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>
Remove some cruft from Sphinx config files, drop the use of 'u' prefixed
strings, which are unnecessary in Python 3, and generally tidy stuff up.
Change-Id: Ib0f33576e160ec842d7fc82b4fcfee99829623d7
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Mostly a find-replace job. Let's do this now so we don't have to carry
it for the next decade.
Change-Id: I7bef9fb7c6895f746cee1aca6522786f38b9857c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
The following message is shown currently in the reboot operation.
Request to reboot server <Server: server1> has been accepted.
The server name string is a bit odd. So fix it as follows.
Request to reboot server server1
(ff79e91e-e2a7-4e0f-b4c3-7157676d43c9) has been accepted.
Change-Id: I62df4589dc950f69fdc23eafcbb5792e897cb635
Closes-Bug: #1785495
I suppose that methods get_resource_manager_extra_kwargs and
add_resource_manager_extra_kwargs_hook were designed in those days when
Nova API had extensions.
Nowdays, Nova API has strict schema validation of requests, so no
additional arguments are allowed and these methods look redundant.
The fact that get_resource_manager_extra_kwargs lists of the objects
added by add_resource_manager_extra_kwargs_hook whereas
add_resource_manager_extra_kwargs_hook is not called anywhere
doesn't add chances for leaving these methods in our code.
Compatibility: both methods are designed for CLI and the CLI behaviour
will not change after removing them, so we can do a cleanup without
following standard deprecation cycle.
Change-Id: Id61457c3db8a17e2294dc579b2519873927fec48
There are some duplicated code in nova client for generating
query string.
The 'prepare_query_string' method can convert dict params to
query string(it transforms the dict to a sequence of two-element
tuples in fixed order, then the encoded string will be consistent
in Python 2&3.)
This patch use utils.prepare_query_string instead of these and
plus some notes in the 'prepare_query_string' method.
Change-Id: Idb3c5e97f8bbcd5ec5446f776c10fa8c84b54d5d
Closes-Bug: 1727968
When a dict is flattened, if a value of an item is empty,
e.g. {"cpu_info": {}}, the item is not displayed.
This patch fixes _flatten method to display such an item including an
empty dict.
Change-Id: I2e4ada0de217c5c4ddea10f3f283c6d8e78083b6
Related-Bug: #1594230
This change allows novaclient to get several hypervisors
with the help of new optional parameters 'limit' and 'marker'
which were added to hipervisor-list command.
Change-Id: Ib723fb1dc1cd57b6f796bb93e0dd8ddf2da4b2a0
Added wrapper classes which are inherited from base data types str,
list, tuple and dict. Each of these wrapper classes and
the Resource class contain a 'request_ids' attribute
which is populated with a 'x-compute-request-id' or
a 'x-openstack-request-id' received in a header from a response body.
This change is required to return 'request_id' from
client to log request_id mappings of cross projects.
This patch is one of a series of patches for implementing
return-request-id-to-caller.
Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I422c4f4ee59991ca89a0a16f548b537c8b61bb97
Implements: blueprint return-request-id-to-caller
some fields such as instance.display_name can be unicode,
nova client should not translate it to 'str'. otherwise
it will report UnicodeEncodeError.
Change-Id: I4f6011105b3b11dbbcb23f3a7c1bbcf7f20bcc8c
Closes-Bug: 1518141
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
The expected behavior is when timing is True, then we record each
request's time, then we should call reset_timings() to release memory.
However, the shell, client.{HTTPClient,SessionClient} will record each
request's time no matter what timing is set, then after long running
time in service like ceilometer-agent-compute, the memory keeps increasing.
We'd better not record request's time when timing is set to False.
Users are not responiable to call reset_timings() when they don't want
timing functionality.
Change-Id: I3e7d2fadf9a21be018781d528a1b6562228da6dd
Closes-Bug: #1433491
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
Fixed redeclared test_names for two test functions that pass now:
1) 'test_list_security_groups_all_tenants_on'
2) 'test_find_by_str_name'
Small spelling corrections
TrivialFix
Change-Id: Iacb0ce5697779f9342c22a22cb2f29a8e063b459
Currently find_resource() searches resource with human_id before does
with name_attr. With this logic, find_resource() cannot identify
upper/lower case. In find_resource(), human_id always matches and
name_attr never used in find_resource() because human_id made from
small letters of name_attr string (see bug/1318503).
To identify upper/lower case, name_attr should be used before human_id.
This fix moves name_attr to ahead of human_id with unit-test cases.
Change-Id: I9b821d7111c11a97be38f19de06172daf410022d
Closes-Bug: #1318503
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