diff options
| author | Gorka Eguileor <geguileo@redhat.com> | 2017-07-19 14:45:13 +0200 |
|---|---|---|
| committer | Gorka Eguileor <geguileo@redhat.com> | 2017-07-19 14:45:13 +0200 |
| commit | 52cc5c6cb3856dcddd455122742a5bf8de0fe834 (patch) | |
| tree | e60be3273ca36882ec784e1e951534c1feb6bbcb /cinderclient/client.py | |
| parent | 83230498eb75ce080de4fe6806b8079b0b87b144 (diff) | |
| download | python-cinderclient-52cc5c6cb3856dcddd455122742a5bf8de0fe834.tar.gz | |
Fix highest version supported by client and server
Current code mistakenly thinks that 3.40 is older than 3.27, because
it's treating 3.40 as 3.4, thus returning the wrong maximum supported
version by both server and client.
It is also returning a 3.40 version as 3.4 because it's returning it as
a float.
This patch fixes both issues by not using float conversion but using the
APIVersion object to do the comparison and by changing returned type to
a string so it can be used to instantiate a client.
Change-Id: Ica4d718b3de31c31da047f07c5154b242e122596
Closes-Bug: #1705093
Diffstat (limited to 'cinderclient/client.py')
| -rw-r--r-- | cinderclient/client.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cinderclient/client.py b/cinderclient/client.py index 485be9f..57ebd17 100644 --- a/cinderclient/client.py +++ b/cinderclient/client.py @@ -96,10 +96,10 @@ def get_server_version(url): def get_highest_client_server_version(url): + """Returns highest supported version by client and server as a string.""" min_server, max_server = get_server_version(url) - max_server_version = api_versions.APIVersion.get_string(max_server) - - return min(float(max_server_version), float(api_versions.MAX_VERSION)) + max_client = api_versions.APIVersion(api_versions.MAX_VERSION) + return min(max_server, max_client).get_string() def get_volume_api_from_url(url): |
