From 79ad64845f8df6e0d14728d49164015ff88013a7 Mon Sep 17 00:00:00 2001 From: miaohb Date: Thu, 28 Sep 2017 23:39:28 -0700 Subject: [PATCH] Consolidate API version in client This patch calculates the value of LAST_KNOWN_API_VERSION from DEFAULT_CONTAINER_API_VERSION, which can avoid to bump api version in two places. Change-Id: I68c51c28ef2f8f548d99276187675505d2fb2796 Closes-Bug: #1717402 --- zunclient/osc/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zunclient/osc/plugin.py b/zunclient/osc/plugin.py index 64ad174b..32dc5736 100644 --- a/zunclient/osc/plugin.py +++ b/zunclient/osc/plugin.py @@ -22,7 +22,7 @@ LOG = logging.getLogger(__name__) DEFAULT_CONTAINER_API_VERSION = api_versions.DEFAULT_API_VERSION API_VERSION_OPTION = "os_container_api_version" API_NAME = "container" -LAST_KNOWN_API_VERSION = 9 +LAST_KNOWN_API_VERSION = int(DEFAULT_CONTAINER_API_VERSION.split('.')[1]) API_VERSIONS = { '1.%d' % i: 'zunclient.v1.client.Client' for i in range(1, LAST_KNOWN_API_VERSION + 1)