Skip to content

Commit c8a361b

Browse files
committed
Closes #55, make api version used in responses dynamic
1 parent d6ffc9b commit c8a361b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

ec2stack/helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ def successful_response(**kwargs):
309309
@param kwargs: Parameters to render the template with.
310310
@return: Response.
311311
"""
312-
content = render_template(request_id=uuid(), **kwargs)
312+
api_version = str(get("Version"))
313+
content = render_template(request_id=uuid(), api_version=api_version, **kwargs)
313314
response = make_response(content)
314315
return _create_response(response, '200')
315316

ec2stack/providers/cloudstack/tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,5 @@ def _describe_tags_response(response):
148148
return {
149149
'template_name_or_list': 'tags.xml',
150150
'response_type': 'DescribeTagsResponse',
151-
'response': response
151+
'response': response['listtagsresponse']
152152
}

ec2stack/templates/response.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<{{response_type}}{% if not error %} xmlns="http://ec2.amazonaws.com/doc/2014-05-01/"{%endif%}>
2+
<{{response_type}}{% if not error %} xmlns="http://ec2.amazonaws.com/doc/{{api_version}}/"{%endif%}>
33
{% block response_content %}{% endblock %}
44
{% if request_id %}
55
<RequestId>{{request_id}}</RequestId>

0 commit comments

Comments
 (0)