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: I0e430457af3033ebf56e47f85c0cfd71d2227cf7
This commit is contained in:
Tang Chen 2016-06-29 16:15:03 +08:00
parent f1c9930436
commit bfde2f8e09
12 changed files with 36 additions and 47 deletions

View File

@ -12,12 +12,12 @@
#
# Copyright 2015 IBM Corp.
from cliff import show
from osc_lib.command import command
import six
import sys
class RawFormat(show.ShowOne):
class RawFormat(command.ShowOne):
def produce_output(self, parsed_args, column_names, data):
if data is None:

View File

@ -16,13 +16,13 @@
import logging
import six
from cliff import show
from osc_lib.command import command
from osc_lib import utils
from heatclient.common import utils as heat_utils
class BuildInfo(show.ShowOne):
class BuildInfo(command.ShowOne):
"""Retrieve build information."""
log = logging.getLogger(__name__ + ".BuildInfo")

View File

@ -16,8 +16,7 @@ import logging
import time
from cliff.formatters import base
from cliff import lister
from cliff import show
from osc_lib.command import command
from osc_lib import utils
from heatclient.common import event_utils
@ -26,7 +25,7 @@ from heatclient import exc
from heatclient.openstack.common._i18n import _
class ShowEvent(show.ShowOne):
class ShowEvent(command.ShowOne):
"""Show event details."""
log = logging.getLogger(__name__ + '.ShowEvent')
@ -82,7 +81,7 @@ class ShowEvent(show.ShowOne):
formatters=formatters)
class ListEvent(lister.Lister):
class ListEvent(command.Lister):
"""List events."""
log = logging.getLogger(__name__ + '.ListEvent')

View File

@ -13,13 +13,11 @@
"""Orchestration v1 Stack action implementations"""
from cliff import command
import logging
import six
from six.moves.urllib import request
from cliff import lister
from cliff import show
from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib.i18n import _
from osc_lib import utils
@ -30,7 +28,7 @@ from heatclient.common import utils as heat_utils
from heatclient import exc as heat_exc
class ResourceShow(show.ShowOne):
class ResourceShow(command.ShowOne):
"""Display stack resource."""
log = logging.getLogger(__name__ + '.ResourceShowStack')
@ -73,7 +71,7 @@ class ResourceShow(show.ShowOne):
return self.dict2columns(resource.to_dict())
class ResourceList(lister.Lister):
class ResourceList(command.Lister):
"""List stack resources."""
log = logging.getLogger(__name__ + '.ResourceListStack')

View File

@ -16,10 +16,10 @@
import logging
import six
from cliff import lister
from heatclient.common import format_utils
from heatclient.common import utils as heat_utils
from heatclient import exc as heat_exc
from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib.i18n import _
@ -84,7 +84,7 @@ def _show_resourcetype(heat_client, parsed_args):
return columns, rows
class ResourceTypeList(lister.Lister):
class ResourceTypeList(command.Lister):
"""List resource types."""
log = logging.getLogger(__name__ + '.ResourceTypeList')

View File

@ -15,11 +15,11 @@
import logging
from cliff import lister
from osc_lib.command import command
from osc_lib import utils
class ListService(lister.Lister):
class ListService(command.Lister):
"""List the Heat engines."""
log = logging.getLogger(__name__ + ".ListService")

View File

@ -16,9 +16,7 @@
import logging
import six
from cliff import command
from cliff import lister
from cliff import show
from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib.i18n import _
from osc_lib import utils
@ -27,7 +25,7 @@ from heatclient.common import format_utils
from heatclient import exc as heat_exc
class ListSnapshot(lister.Lister):
class ListSnapshot(command.Lister):
"""List stack snapshots."""
log = logging.getLogger(__name__ + ".ListSnapshot")
@ -137,7 +135,7 @@ class RestoreSnapshot(command.Command):
'snapshot': parsed_args.snapshot})
class CreateSnapshot(show.ShowOne):
class CreateSnapshot(command.ShowOne):
"""Create stack snapshot."""
log = logging.getLogger(__name__ + ".CreateSnapshot")

View File

@ -19,8 +19,7 @@ import six
from six.moves.urllib import request
import yaml
from cliff import command
from cliff import lister
from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib import utils
@ -73,7 +72,7 @@ def _delete_config(heat_client, args):
'total': len(args.config)})
class ListConfig(lister.Lister):
class ListConfig(command.Lister):
"""List software configs"""
log = logging.getLogger(__name__ + ".ListConfig")

View File

@ -16,10 +16,7 @@
import logging
from oslo_serialization import jsonutils
from cliff import command
from cliff import lister
from cliff import show
from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib import utils
@ -182,7 +179,7 @@ class DeleteDeployment(command.Command):
'total': len(parsed_args.deployment)})
class ListDeployment(lister.Lister):
class ListDeployment(command.Lister):
"""List software deployments."""
log = logging.getLogger(__name__ + '.ListDeployment')
@ -222,7 +219,7 @@ def _list_deployment(heat_client, args=None):
)
class ShowDeployment(show.ShowOne):
class ShowDeployment(command.ShowOne):
"""Show SoftwareDeployment Details."""
log = logging.getLogger(__name__ + ".ShowSoftwareDeployment")

View File

@ -16,10 +16,8 @@
import logging
import sys
from cliff import command
from cliff import lister
from cliff import show
from osc_lib.cli import parseractions
from osc_lib.command import command
from osc_lib import exceptions as exc
from osc_lib import utils
from oslo_serialization import jsonutils
@ -37,7 +35,7 @@ from heatclient.openstack.common._i18n import _
from heatclient.openstack.common._i18n import _LI
class CreateStack(show.ShowOne):
class CreateStack(command.ShowOne):
"""Create a stack."""
log = logging.getLogger(__name__ + '.CreateStack')
@ -188,7 +186,7 @@ class CreateStack(show.ShowOne):
return _show_stack(client, stack['id'], format='table', short=True)
class UpdateStack(show.ShowOne):
class UpdateStack(command.ShowOne):
"""Update a stack."""
log = logging.getLogger(__name__ + '.UpdateStack')
@ -359,7 +357,7 @@ class UpdateStack(show.ShowOne):
short=True)
class ShowStack(show.ShowOne):
class ShowStack(command.ShowOne):
"""Show stack details."""
log = logging.getLogger(__name__ + ".ShowStack")
@ -427,7 +425,7 @@ def _show_stack(heat_client, stack_id, format='', short=False):
formatters=formatters)
class ListStack(lister.Lister):
class ListStack(command.Lister):
"""List stacks."""
log = logging.getLogger(__name__ + '.ListStack')
@ -696,7 +694,7 @@ class DeleteStack(command.Command):
raise exc.CommandError(msg)
class AdoptStack(show.ShowOne):
class AdoptStack(command.ShowOne):
"""Adopt a stack."""
log = logging.getLogger(__name__ + '.AdoptStack')
@ -823,7 +821,7 @@ class AbandonStack(format_utils.JsonFormat):
return columns, data
class OutputShowStack(show.ShowOne):
class OutputShowStack(command.ShowOne):
"""Show stack output."""
log = logging.getLogger(__name__ + '.OutputShowStack')
@ -908,7 +906,7 @@ class OutputShowStack(show.ShowOne):
return self.dict2columns(output)
class OutputListStack(lister.Lister):
class OutputListStack(command.Lister):
"""List stack outputs."""
log = logging.getLogger(__name__ + '.OutputListStack')
@ -973,7 +971,7 @@ class TemplateShowStack(format_utils.YamlFormat):
return self.dict2columns(template)
class StackActionBase(lister.Lister):
class StackActionBase(command.Lister):
"""Stack actions base."""
log = logging.getLogger(__name__ + '.StackActionBase')
@ -1161,7 +1159,7 @@ class CancelStack(StackActionBase):
return (columns, rows)
class StackHookPoll(lister.Lister):
class StackHookPoll(command.Lister):
'''List resources with pending hook for a stack.'''
log = logging.getLogger(__name__ + '.StackHookPoll')

View File

@ -14,7 +14,7 @@
import collections
from cliff import command
from osc_lib.command import command
from heatclient.common import format_utils
from heatclient import exc

View File

@ -16,7 +16,7 @@ import logging
import six
from cliff import lister
from osc_lib.command import command
from osc_lib import utils
from heatclient.common import format_utils
@ -27,7 +27,7 @@ from heatclient import exc
from heatclient.openstack.common._i18n import _
class VersionList(lister.Lister):
class VersionList(command.Lister):
"""List the available template versions."""
log = logging.getLogger(__name__ + '.VersionList')
@ -46,7 +46,7 @@ class VersionList(lister.Lister):
)
class FunctionList(lister.Lister):
class FunctionList(command.Lister):
"""List the available functions."""
log = logging.getLogger(__name__ + '.FunctionList')