From ae553f450a127db40117401c958f1d57fdadad1f Mon Sep 17 00:00:00 2001
From: Ivan Kolodyazhny <e0ne@e0ne.info>
Date: Wed, 14 Oct 2015 20:33:08 +0300
Subject: [PATCH] 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
---
 cinder/api/openstack/wsgi.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

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')
-- 
2.45.2