diff options
author | Matt Riedemann <mriedem@us.ibm.com> | 2016-08-19 14:33:11 -0400 |
---|---|---|
committer | Matt Riedemann <mriedem@us.ibm.com> | 2016-08-19 15:07:32 -0400 |
commit | 4215e3fd2f0a32e5f6b5f05aa4f4656efee384d2 (patch) | |
tree | 3833f85752e33acfe68a3c84c4f676a6a21359b8 | |
parent | aaebeb05a03e34281a091dc6dfc4672b01cdfbbb (diff) | |
download | python-novaclient-4215e3fd2f0a32e5f6b5f05aa4f4656efee384d2.tar.gz |
Cap baremetal python APIs at 2.35
The 2.36 microversion makes the baremetal APIs return a 404
so rather than get that back, this change wraps the baremetal
python API methods so they are capped at 2.35. Using them
after that version will raise VersionNotFoundForAPIMethod.
Related to blueprint deprecate-api-proxies
Change-Id: Icc9fc7ce2e2115ce101d95c37024223d1d650fa2
-rw-r--r-- | novaclient/v2/contrib/baremetal.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/novaclient/v2/contrib/baremetal.py b/novaclient/v2/contrib/baremetal.py index 7f013881..57933891 100644 --- a/novaclient/v2/contrib/baremetal.py +++ b/novaclient/v2/contrib/baremetal.py @@ -22,6 +22,7 @@ from __future__ import print_function import sys import warnings +from novaclient import api_versions from novaclient import base from novaclient.i18n import _ from novaclient import utils @@ -64,6 +65,7 @@ class BareMetalNodeManager(base.ManagerWithFind): """ resource_class = BareMetalNode + @api_versions.wraps('2.0', '2.35') def get(self, node_id): """ DEPRECATED: Get a baremetal node. @@ -74,6 +76,7 @@ class BareMetalNodeManager(base.ManagerWithFind): warnings.warn(DEPRECATION_WARNING, DeprecationWarning) return self._get("/os-baremetal-nodes/%s" % node_id, 'node') + @api_versions.wraps('2.0', '2.35') def list(self): """ DEPRECATED: Get a list of all baremetal nodes. @@ -83,6 +86,7 @@ class BareMetalNodeManager(base.ManagerWithFind): warnings.warn(DEPRECATION_WARNING, DeprecationWarning) return self._list('/os-baremetal-nodes', 'nodes') + @api_versions.wraps('2.0', '2.35') def list_interfaces(self, node_id): """ DEPRECATED: List the interfaces on a baremetal node. |