Fix problem about location header in Zaqar resource2

The name string of location header of Zaqar API response is
lower case. This is inconsistent with the guide from API-WG
and thus make sdk unable to parse location header correctly.
This patch provides a workaround for this issue.

Change-Id: I77a474b17aed55b215eb93a3666d444728ded1e9
This commit is contained in:
yanyanhu
2016-10-18 23:38:32 -04:00
parent f3795734b2
commit 32aece6268
4 changed files with 20 additions and 0 deletions

View File

@@ -17,6 +17,11 @@ from openstack import resource2
class Claim(resource2.Resource):
# FIXME(anyone): The name string of `location` field of Zaqar API response
# is lower case. That is inconsistent with the guide from API-WG. This is
# a workaround for this issue.
location = resource2.Header("location")
resources_key = 'claims'
base_path = '/queues/%(queue_name)s/claims'
service = message_service.MessageService()

View File

@@ -17,6 +17,11 @@ from openstack import resource2
class Message(resource2.Resource):
# FIXME(anyone): The name string of `location` field of Zaqar API response
# is lower case. That is inconsistent with the guide from API-WG. This is
# a workaround for this issue.
location = resource2.Header("location")
resources_key = 'messages'
base_path = '/queues/%(queue_name)s/messages'
service = message_service.MessageService()

View File

@@ -17,6 +17,11 @@ from openstack import resource2
class Queue(resource2.Resource):
# FIXME(anyone): The name string of `location` field of Zaqar API response
# is lower case. That is inconsistent with the guide from API-WG. This is
# a workaround for this issue.
location = resource2.Header("location")
resources_key = "queues"
base_path = "/queues"
service = message_service.MessageService()

View File

@@ -17,6 +17,11 @@ from openstack import resource2
class Subscription(resource2.Resource):
# FIXME(anyone): The name string of `location` field of Zaqar API response
# is lower case. That is inconsistent with the guide from API-WG. This is
# a workaround for this issue.
location = resource2.Header("location")
resources_key = 'subscriptions'
base_path = '/queues/%(queue_name)s/subscriptions'
service = message_service.MessageService()