Deprecate QUEUE_ID in heat_zaqar

ZaqarQueue in heat_zaqar has 2 ways to receive the ID of the queue:
- use get_attr(QUEUE_ID)
- use get_resource <resource_name> or Ref
The first way has been deprecated because in common practice
it had better use get_recources for receive an ID of the resource.
In addition, this attribute has been excluded from auto-tests
for ZaqarQueue.

Change-Id: I43d07401b580555fe5bfa443836e60a708ce54bf
This commit is contained in:
kairat_kushaev 2015-01-20 15:01:02 +03:00
parent 6e06155b2e
commit fbda16fcab
2 changed files with 9 additions and 3 deletions

View File

@ -17,6 +17,7 @@ from heat.engine import attributes
from heat.engine import clients from heat.engine import clients
from heat.engine import properties from heat.engine import properties
from heat.engine import resource from heat.engine import resource
from heat.engine import support
def resource_mapping(): def resource_mapping():
@ -58,7 +59,13 @@ class ZaqarQueue(resource.Resource):
attributes_schema = { attributes_schema = {
QUEUE_ID: attributes.Schema( QUEUE_ID: attributes.Schema(
_("ID of the queue."), _("ID of the queue."),
cache_mode=attributes.Schema.CACHE_NONE cache_mode=attributes.Schema.CACHE_NONE,
support_status=support.SupportStatus(
status=support.DEPRECATED,
message=_("Deprecated in kilo. "
"Use get_resource|Ref command instead. "
"For example: { get_resource : <resource_name> }")
)
), ),
HREF: attributes.Schema( HREF: attributes.Schema(
_("The resource href of the queue.") _("The resource href of the queue.")

View File

@ -46,7 +46,7 @@ wp_template = '''
}, },
"Outputs" : { "Outputs" : {
"queue_id": { "queue_id": {
"Value": { "Fn::GetAtt" : [ "MyQueue2", "queue_id" ]}, "Value": { "Ref" : "MyQueue2" },
"Description": "queue name" "Description": "queue name"
}, },
"queue_href": { "queue_href": {
@ -116,7 +116,6 @@ class ZaqarMessageQueueTest(common.HeatTestCase):
scheduler.TaskRunner(queue.create)() scheduler.TaskRunner(queue.create)()
self.fc.api_url = 'http://127.0.0.1:8888/v1' self.fc.api_url = 'http://127.0.0.1:8888/v1'
self.assertEqual('myqueue', queue.FnGetAtt('queue_id'))
self.assertEqual('http://127.0.0.1:8888/v1/queues/myqueue', self.assertEqual('http://127.0.0.1:8888/v1/queues/myqueue',
queue.FnGetAtt('href')) queue.FnGetAtt('href'))