Add a read-only property for Queues
Queue's name is currently a private attribute in the Queue object. Since this attribute may need to be accessed, this patch adds a read-only property that returns the value of the private attribute. Change-Id: I175d6e2d3b8990f8dbea3c44351143067efacff3
This commit is contained in:
parent
f96846d323
commit
ebb8d56f13
@ -44,8 +44,7 @@ class CreateQueue(show.ShowOne):
|
|||||||
data = client.queue(queue_name)
|
data = client.queue(queue_name)
|
||||||
|
|
||||||
columns = ('Name',)
|
columns = ('Name',)
|
||||||
properties = ("_Name",)
|
return columns, utils.get_item_properties(data, columns)
|
||||||
return columns, utils.get_item_properties(data, properties)
|
|
||||||
|
|
||||||
|
|
||||||
class DeleteQueue(command.Command):
|
class DeleteQueue(command.Command):
|
||||||
@ -101,9 +100,8 @@ class ListQueues(lister.Lister):
|
|||||||
|
|
||||||
data = client.queues(**kwargs)
|
data = client.queues(**kwargs)
|
||||||
columns = ("Name", )
|
columns = ("Name", )
|
||||||
properties = ("_Name",)
|
|
||||||
return (columns,
|
return (columns,
|
||||||
(utils.get_item_properties(s, properties) for s in data))
|
(utils.get_item_properties(s, columns) for s in data))
|
||||||
|
|
||||||
|
|
||||||
class CheckQueueExistence(show.ShowOne):
|
class CheckQueueExistence(show.ShowOne):
|
||||||
|
@ -31,6 +31,10 @@ class Queue(object):
|
|||||||
if auto_create:
|
if auto_create:
|
||||||
self.ensure_exists()
|
self.ensure_exists()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
return self._name
|
||||||
|
|
||||||
def exists(self):
|
def exists(self):
|
||||||
"""Checks if the queue exists."""
|
"""Checks if the queue exists."""
|
||||||
req, trans = self.client._request_and_transport()
|
req, trans = self.client._request_and_transport()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user