Use osc_lib instead of cliff
Base classes of commands are defined in cliff, but have been encapsulated again in osc-lib for all plugin clients. So use osc-lib instead of cliff. Change-Id: Iaabc7beaa5891e354b7a8876aa73c488fa86a09b
This commit is contained in:
@@ -15,9 +15,7 @@
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from cliff import command
|
from osc_lib.command import command
|
||||||
from cliff import lister
|
|
||||||
from cliff import show
|
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
from zaqarclient.transport import errors
|
from zaqarclient.transport import errors
|
||||||
@@ -28,7 +26,7 @@ def _get_client(obj, parsed_args):
|
|||||||
return obj.app.client_manager.messaging
|
return obj.app.client_manager.messaging
|
||||||
|
|
||||||
|
|
||||||
class CreateQueue(show.ShowOne):
|
class CreateQueue(command.ShowOne):
|
||||||
"""Create a queue"""
|
"""Create a queue"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".CreateQueue")
|
log = logging.getLogger(__name__ + ".CreateQueue")
|
||||||
@@ -68,7 +66,7 @@ class DeleteQueue(command.Command):
|
|||||||
client.queue(queue_name).delete()
|
client.queue(queue_name).delete()
|
||||||
|
|
||||||
|
|
||||||
class ListQueues(lister.Lister):
|
class ListQueues(command.Lister):
|
||||||
"""List available queues"""
|
"""List available queues"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".ListQueues")
|
log = logging.getLogger(__name__ + ".ListQueues")
|
||||||
@@ -100,7 +98,7 @@ class ListQueues(lister.Lister):
|
|||||||
(utils.get_item_properties(s, columns) for s in data))
|
(utils.get_item_properties(s, columns) for s in data))
|
||||||
|
|
||||||
|
|
||||||
class CheckQueueExistence(show.ShowOne):
|
class CheckQueueExistence(command.ShowOne):
|
||||||
"""Check queue existence"""
|
"""Check queue existence"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".CheckQueueExistence")
|
log = logging.getLogger(__name__ + ".CheckQueueExistence")
|
||||||
@@ -158,7 +156,7 @@ class SetQueueMetadata(command.Command):
|
|||||||
metadata(new_meta=valid_metadata)
|
metadata(new_meta=valid_metadata)
|
||||||
|
|
||||||
|
|
||||||
class GetQueueMetadata(show.ShowOne):
|
class GetQueueMetadata(command.ShowOne):
|
||||||
"""Get queue metadata"""
|
"""Get queue metadata"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".GetQueueMetadata")
|
log = logging.getLogger(__name__ + ".GetQueueMetadata")
|
||||||
@@ -184,7 +182,7 @@ class GetQueueMetadata(show.ShowOne):
|
|||||||
return columns, utils.get_dict_properties(data, columns)
|
return columns, utils.get_dict_properties(data, columns)
|
||||||
|
|
||||||
|
|
||||||
class GetQueueStats(show.ShowOne):
|
class GetQueueStats(command.ShowOne):
|
||||||
"""Get queue stats"""
|
"""Get queue stats"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".GetQueueStats")
|
log = logging.getLogger(__name__ + ".GetQueueStats")
|
||||||
@@ -212,7 +210,7 @@ class GetQueueStats(show.ShowOne):
|
|||||||
return columns, utils.get_dict_properties(data, columns)
|
return columns, utils.get_dict_properties(data, columns)
|
||||||
|
|
||||||
|
|
||||||
class CreatePool(show.ShowOne):
|
class CreatePool(command.ShowOne):
|
||||||
"""Create a pool"""
|
"""Create a pool"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".CreatePool")
|
log = logging.getLogger(__name__ + ".CreatePool")
|
||||||
@@ -267,7 +265,7 @@ class CreatePool(show.ShowOne):
|
|||||||
return columns, utils.get_item_properties(data, columns)
|
return columns, utils.get_item_properties(data, columns)
|
||||||
|
|
||||||
|
|
||||||
class ShowPool(show.ShowOne):
|
class ShowPool(command.ShowOne):
|
||||||
"""Display pool details"""
|
"""Display pool details"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".ShowPool")
|
log = logging.getLogger(__name__ + ".ShowPool")
|
||||||
@@ -290,7 +288,7 @@ class ShowPool(show.ShowOne):
|
|||||||
return columns, utils.get_dict_properties(pool_data, columns)
|
return columns, utils.get_dict_properties(pool_data, columns)
|
||||||
|
|
||||||
|
|
||||||
class UpdatePool(show.ShowOne):
|
class UpdatePool(command.ShowOne):
|
||||||
"""Update a pool attribute"""
|
"""Update a pool attribute"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__+".UpdatePool")
|
log = logging.getLogger(__name__+".UpdatePool")
|
||||||
@@ -361,7 +359,7 @@ class DeletePool(command.Command):
|
|||||||
client.pool(pool_name, auto_create=False).delete()
|
client.pool(pool_name, auto_create=False).delete()
|
||||||
|
|
||||||
|
|
||||||
class ListPools(lister.Lister):
|
class ListPools(command.Lister):
|
||||||
"""List available Pools"""
|
"""List available Pools"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".ListPools")
|
log = logging.getLogger(__name__ + ".ListPools")
|
||||||
@@ -403,7 +401,7 @@ class ListPools(lister.Lister):
|
|||||||
(utils.get_item_properties(s, columns) for s in data))
|
(utils.get_item_properties(s, columns) for s in data))
|
||||||
|
|
||||||
|
|
||||||
class UpdateFlavor(show.ShowOne):
|
class UpdateFlavor(command.ShowOne):
|
||||||
"""Update a flavor's attributes"""
|
"""Update a flavor's attributes"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__+".UpdateFlavor")
|
log = logging.getLogger(__name__+".UpdateFlavor")
|
||||||
@@ -441,7 +439,7 @@ class UpdateFlavor(show.ShowOne):
|
|||||||
return columns, utils.get_dict_properties(flavor_data, columns)
|
return columns, utils.get_dict_properties(flavor_data, columns)
|
||||||
|
|
||||||
|
|
||||||
class CreateFlavor(show.ShowOne):
|
class CreateFlavor(command.ShowOne):
|
||||||
"""Create a pool flavor"""
|
"""Create a pool flavor"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".CreateFlavor")
|
log = logging.getLogger(__name__ + ".CreateFlavor")
|
||||||
@@ -502,7 +500,7 @@ class DeleteFlavor(command.Command):
|
|||||||
client.flavor(flavor_name).delete()
|
client.flavor(flavor_name).delete()
|
||||||
|
|
||||||
|
|
||||||
class ShowFlavor(show.ShowOne):
|
class ShowFlavor(command.ShowOne):
|
||||||
"""Display flavor details"""
|
"""Display flavor details"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".ShowFlavor")
|
log = logging.getLogger(__name__ + ".ShowFlavor")
|
||||||
@@ -525,7 +523,7 @@ class ShowFlavor(show.ShowOne):
|
|||||||
return columns, utils.get_dict_properties(flavor_data, columns)
|
return columns, utils.get_dict_properties(flavor_data, columns)
|
||||||
|
|
||||||
|
|
||||||
class ListFlavors(lister.Lister):
|
class ListFlavors(command.Lister):
|
||||||
"""List available flavors"""
|
"""List available flavors"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".ListFlavors")
|
log = logging.getLogger(__name__ + ".ListFlavors")
|
||||||
@@ -565,7 +563,7 @@ class ListFlavors(lister.Lister):
|
|||||||
(utils.get_item_properties(s, columns) for s in data))
|
(utils.get_item_properties(s, columns) for s in data))
|
||||||
|
|
||||||
|
|
||||||
class CreateClaim(lister.Lister):
|
class CreateClaim(command.Lister):
|
||||||
"""Create claim and return a list of claimed messages"""
|
"""Create claim and return a list of claimed messages"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".CreateClaim")
|
log = logging.getLogger(__name__ + ".CreateClaim")
|
||||||
@@ -616,7 +614,7 @@ class CreateClaim(lister.Lister):
|
|||||||
(utils.get_item_properties(s, keys) for s in data))
|
(utils.get_item_properties(s, keys) for s in data))
|
||||||
|
|
||||||
|
|
||||||
class QueryClaim(lister.Lister):
|
class QueryClaim(command.Lister):
|
||||||
"""Display claim details"""
|
"""Display claim details"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".QueryClaim")
|
log = logging.getLogger(__name__ + ".QueryClaim")
|
||||||
@@ -646,7 +644,7 @@ class QueryClaim(lister.Lister):
|
|||||||
(utils.get_item_properties(s, keys) for s in data))
|
(utils.get_item_properties(s, keys) for s in data))
|
||||||
|
|
||||||
|
|
||||||
class RenewClaim(lister.Lister):
|
class RenewClaim(command.Lister):
|
||||||
"""Renew a claim"""
|
"""Renew a claim"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".RenewClaim")
|
log = logging.getLogger(__name__ + ".RenewClaim")
|
||||||
|
@@ -15,9 +15,7 @@
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from cliff import command
|
from osc_lib.command import command
|
||||||
from cliff import lister
|
|
||||||
from cliff import show
|
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
from zaqarclient.queues.v1 import cli
|
from zaqarclient.queues.v1 import cli
|
||||||
@@ -127,7 +125,7 @@ class ListFlavors(cli.ListFlavors):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class CreateSubscription(show.ShowOne):
|
class CreateSubscription(command.ShowOne):
|
||||||
"""Create a subscription for queue"""
|
"""Create a subscription for queue"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".CreateSubscription")
|
log = logging.getLogger(__name__ + ".CreateSubscription")
|
||||||
@@ -174,7 +172,7 @@ class CreateSubscription(show.ShowOne):
|
|||||||
return columns, utils.get_item_properties(data, columns)
|
return columns, utils.get_item_properties(data, columns)
|
||||||
|
|
||||||
|
|
||||||
class UpdateSubscription(show.ShowOne):
|
class UpdateSubscription(command.ShowOne):
|
||||||
"""Update a subscription"""
|
"""Update a subscription"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".UpdateSubscription")
|
log = logging.getLogger(__name__ + ".UpdateSubscription")
|
||||||
@@ -249,7 +247,7 @@ class DeleteSubscription(command.Command):
|
|||||||
auto_create=False).delete()
|
auto_create=False).delete()
|
||||||
|
|
||||||
|
|
||||||
class ShowSubscription(show.ShowOne):
|
class ShowSubscription(command.ShowOne):
|
||||||
"""Display subscription details"""
|
"""Display subscription details"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".ShowSubscription")
|
log = logging.getLogger(__name__ + ".ShowSubscription")
|
||||||
@@ -277,7 +275,7 @@ class ShowSubscription(show.ShowOne):
|
|||||||
return columns, utils.get_dict_properties(pool_data.__dict__, columns)
|
return columns, utils.get_dict_properties(pool_data.__dict__, columns)
|
||||||
|
|
||||||
|
|
||||||
class ListSubscriptions(lister.Lister):
|
class ListSubscriptions(command.Lister):
|
||||||
"""List available subscriptions"""
|
"""List available subscriptions"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".ListSubscriptions")
|
log = logging.getLogger(__name__ + ".ListSubscriptions")
|
||||||
@@ -343,7 +341,7 @@ class ReleaseClaim(cli.ReleaseClaim):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class CreateSignedUrl(show.ShowOne):
|
class CreateSignedUrl(command.ShowOne):
|
||||||
"""Create a queue"""
|
"""Create a queue"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".CreateSignedUrl")
|
log = logging.getLogger(__name__ + ".CreateSignedUrl")
|
||||||
@@ -405,7 +403,7 @@ class CreateSignedUrl(show.ShowOne):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class Ping(show.ShowOne):
|
class Ping(command.ShowOne):
|
||||||
"""Check if Zaqar server is alive or not"""
|
"""Check if Zaqar server is alive or not"""
|
||||||
|
|
||||||
log = logging.getLogger(__name__ + ".Ping")
|
log = logging.getLogger(__name__ + ".Ping")
|
||||||
|
Reference in New Issue
Block a user