From 349eb960528ca04af3cf4c27abd9574083fb2f80 Mon Sep 17 00:00:00 2001 From: Yuriy Nesenenko Date: Mon, 19 Oct 2015 17:57:59 +0300 Subject: [PATCH] Add the version attribute to the Client class There is a way to get the version of the API being used. We need such feature to work correct with different versions of the Cinder API from third-party tools. Change-Id: Ifde689df08644f9452138a9cd22052bc57fcb5d5 --- cinderclient/v1/client.py | 2 ++ cinderclient/v2/client.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cinderclient/v1/client.py b/cinderclient/v1/client.py index 19a017e..4998dcf 100644 --- a/cinderclient/v1/client.py +++ b/cinderclient/v1/client.py @@ -44,6 +44,8 @@ class Client(object): """ + version = '1' + def __init__(self, username=None, api_key=None, project_id=None, auth_url='', insecure=False, timeout=None, tenant_id=None, proxy_tenant_id=None, proxy_token=None, region_name=None, diff --git a/cinderclient/v2/client.py b/cinderclient/v2/client.py index 0d9abeb..cfcf69d 100644 --- a/cinderclient/v2/client.py +++ b/cinderclient/v2/client.py @@ -47,6 +47,8 @@ class Client(object): ... """ + version = '2' + def __init__(self, username=None, api_key=None, project_id=None, auth_url='', insecure=False, timeout=None, tenant_id=None, proxy_tenant_id=None, proxy_token=None, region_name=None,