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>
In some part in the code we import objects. In the Openstack style guidelines
they recommend to import only modules. [1]: "Do not import objects, only modules".
[1] https://docs.openstack.org/hacking/0.10.3/
Change-Id: Id4b47eeae1d3e86a3cb259c32fcb376ffbd3f8c7
Any object of Resource class or its child class do not compare with
None as expected. For example if a server has been found and is
clearly not None, the test "server!=None" will be False.
This was occuring because the __eq__ implementation was returning the
'NotImplemented' keyword and the __ne__ implementation was returning
the not of __eq__, which in this case will return False as the
expected python behavior for a the not of NotImplemented is False.
Changed the __ne__ implementation to return the correct boolean value
and added the test case that fails with the older implementation and
passes in the current fix.
Change-Id: I6bf5a6e9c9eed4bbcf6678467df19dfea560b4de
Closes-Bug: #1648207
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
Class base.Resource defines __eq__() built-in function, but does
not define __ne__() built-in function, so self.assertEqual works
but self.assertNotEqual does not work at all in this test case in
python2. This patch fixes it by defining __ne__() built-in function
of class base.Resource. Also fixes spelling errors:resoruces.
Change-Id: I39e6f6b94e9490afc14143208e6f20b0ef960991
Closes-Bug: #1586268
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
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
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
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