From: Ivan Kolodyazhny Date: Wed, 14 Oct 2015 17:33:08 +0000 (+0300) Subject: Mark XML API as deprecated in Mitaka. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ae553f450a127db40117401c958f1d57fdadad1f;p=openstack-build%2Fcinder-build.git Mark XML API as deprecated in Mitaka. Cinder XML API is untested and will be removed in the N release. Implements: blueprint deprecate-xml-api Change-Id: I753dedadf99bbb8e49d0076aa0da4ffa4ff97a4b --- diff --git a/cinder/api/openstack/wsgi.py b/cinder/api/openstack/wsgi.py index f2b3215bb..f49047173 100644 --- a/cinder/api/openstack/wsgi.py +++ b/cinder/api/openstack/wsgi.py @@ -22,6 +22,7 @@ from xml.parsers import expat from lxml import etree from oslo_log import log as logging +from oslo_log import versionutils from oslo_serialization import jsonutils from oslo_utils import excutils import six @@ -37,6 +38,7 @@ from cinder.wsgi import common as wsgi XML_NS_V1 = 'http://docs.openstack.org/api/openstack-block-storage/1.0/content' XML_NS_V2 = 'http://docs.openstack.org/api/openstack-block-storage/2.0/content' XML_NS_ATOM = 'http://www.w3.org/2005/Atom' +XML_WARNING = False LOG = logging.getLogger(__name__) @@ -1339,6 +1341,14 @@ class Fault(webob.exc.HTTPException): 'application/json': JSONDictSerializer(), }[content_type] + if content_type == 'application/xml': + global XML_WARNING + if not XML_WARNING: + msg = _('XML support has been deprecated and will be removed ' + 'in the N release.') + versionutils.report_deprecated_feature(LOG, msg) + XML_WARNING = True + body = serializer.serialize(fault_data) if isinstance(body, six.text_type): body = body.encode('utf-8')