~ntt-pf-lab/nova/monkey_patch_notification

« back to all changes in this revision

Viewing changes to nova/api/openstack/faults.py

  • Committer: Lvov Maxim
  • Date: 2011-07-26 05:50:05 UTC
  • mfrom: (1320 nova)
  • mto: This revision was merged to the branch mainline in revision 1322.
  • Revision ID: usrleon@gmail.com-20110726055005-7olsp0giqup3pao7
merge with trunk, resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import webob.dec
20
20
import webob.exc
21
21
 
 
22
from nova.api.openstack import common
22
23
from nova.api.openstack import wsgi
23
24
 
24
25
 
61
62
 
62
63
        content_type = req.best_match_content_type()
63
64
 
 
65
        xml_serializer = {
 
66
            '1.0': wsgi.XMLDictSerializer(metadata, wsgi.XMLNS_V10),
 
67
            '1.1': wsgi.XMLDictSerializer(metadata, wsgi.XMLNS_V11),
 
68
        }[common.get_version_from_href(req.url)]
 
69
 
64
70
        serializer = {
65
 
            'application/xml': wsgi.XMLDictSerializer(metadata=metadata,
66
 
                                                      xmlns=wsgi.XMLNS_V10),
 
71
            'application/xml': xml_serializer,
67
72
            'application/json': wsgi.JSONDictSerializer(),
68
73
        }[content_type]
69
74
 
100
105
        content_type = request.best_match_content_type()
101
106
        metadata = {"attributes": {"overLimitFault": "code"}}
102
107
 
 
108
        xml_serializer = {
 
109
            '1.0': wsgi.XMLDictSerializer(metadata, wsgi.XMLNS_V10),
 
110
            '1.1': wsgi.XMLDictSerializer(metadata, wsgi.XMLNS_V11),
 
111
        }[common.get_version_from_href(request.url)]
 
112
 
103
113
        serializer = {
104
 
            'application/xml': wsgi.XMLDictSerializer(metadata=metadata,
105
 
                                                      xmlns=wsgi.XMLNS_V10),
 
114
            'application/xml': xml_serializer,
106
115
            'application/json': wsgi.JSONDictSerializer(),
107
116
        }[content_type]
108
117