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
This commit is contained in:
Matt Riedemann 2016-08-19 14:33:11 -04:00
parent aaebeb05a0
commit 4215e3fd2f

View File

@ -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.