summaryrefslogtreecommitdiff
path: root/heatclient
diff options
context:
space:
mode:
authorTang Chen <chen.tang@easystack.cn>2016-06-29 16:15:03 +0800
committerTang Chen <chen.tang@easystack.cn>2016-06-29 16:15:03 +0800
commitbfde2f8e09e724869104761d80fe23e61c7004c1 (patch)
tree4a89f8d8a8d94b3adf92b23a0dc52a99f72f47b6 /heatclient
parentf1c9930436b17c800f11cfbccd5399fc847ca8d5 (diff)
downloadpython-heatclient-bfde2f8e09e724869104761d80fe23e61c7004c1.tar.gz
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
Diffstat (limited to 'heatclient')
-rw-r--r--heatclient/common/format_utils.py4
-rw-r--r--heatclient/osc/v1/build_info.py4
-rw-r--r--heatclient/osc/v1/event.py7
-rw-r--r--heatclient/osc/v1/resource.py8
-rw-r--r--heatclient/osc/v1/resource_type.py4
-rw-r--r--heatclient/osc/v1/service.py4
-rw-r--r--heatclient/osc/v1/snapshot.py8
-rw-r--r--heatclient/osc/v1/software_config.py5
-rw-r--r--heatclient/osc/v1/software_deployment.py9
-rw-r--r--heatclient/osc/v1/stack.py22
-rw-r--r--heatclient/osc/v1/stack_failures.py2
-rw-r--r--heatclient/osc/v1/template.py6
12 files changed, 36 insertions, 47 deletions
diff --git a/heatclient/common/format_utils.py b/heatclient/common/format_utils.py
index 2d950c9..0202b6c 100644
--- a/heatclient/common/format_utils.py
+++ b/heatclient/common/format_utils.py
@@ -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:
diff --git a/heatclient/osc/v1/build_info.py b/heatclient/osc/v1/build_info.py
index e8ded76..1bedd87 100644
--- a/heatclient/osc/v1/build_info.py
+++ b/heatclient/osc/v1/build_info.py
@@ -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")
diff --git a/heatclient/osc/v1/event.py b/heatclient/osc/v1/event.py
index 0dc1884..1a6dce3 100644
--- a/heatclient/osc/v1/event.py
+++ b/heatclient/osc/v1/event.py
@@ -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')
diff --git a/heatclient/osc/v1/resource.py b/heatclient/osc/v1/resource.py
index 381a377..a3d998d 100644
--- a/heatclient/osc/v1/resource.py
+++ b/heatclient/osc/v1/resource.py
@@ -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')
diff --git a/heatclient/osc/v1/resource_type.py b/heatclient/osc/v1/resource_type.py
index 265ac98..525a6ff 100644
--- a/heatclient/osc/v1/resource_type.py
+++ b/heatclient/osc/v1/resource_type.py
@@ -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')
diff --git a/heatclient/osc/v1/service.py b/heatclient/osc/v1/service.py
index 1a1ae45..b6a148a 100644
--- a/heatclient/osc/v1/service.py
+++ b/heatclient/osc/v1/service.py
@@ -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")
diff --git a/heatclient/osc/v1/snapshot.py b/heatclient/osc/v1/snapshot.py
index 449b94b..82c8854 100644
--- a/heatclient/osc/v1/snapshot.py
+++ b/heatclient/osc/v1/snapshot.py
@@ -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")
diff --git a/heatclient/osc/v1/software_config.py b/heatclient/osc/v1/software_config.py
index 4e2beb3..555da23 100644
--- a/heatclient/osc/v1/software_config.py
+++ b/heatclient/osc/v1/software_config.py
@@ -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")
diff --git a/heatclient/osc/v1/software_deployment.py b/heatclient/osc/v1/software_deployment.py
index ff33c8d..b9e6796 100644
--- a/heatclient/osc/v1/software_deployment.py
+++ b/heatclient/osc/v1/software_deployment.py
@@ -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")
diff --git a/heatclient/osc/v1/stack.py b/heatclient/osc/v1/stack.py
index cb3f55d..bdb017f 100644
--- a/heatclient/osc/v1/stack.py
+++ b/heatclient/osc/v1/stack.py
@@ -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')
diff --git a/heatclient/osc/v1/stack_failures.py b/heatclient/osc/v1/stack_failures.py
index bc9e88c..257f151 100644
--- a/heatclient/osc/v1/stack_failures.py
+++ b/heatclient/osc/v1/stack_failures.py
@@ -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
diff --git a/heatclient/osc/v1/template.py b/heatclient/osc/v1/template.py
index 5830181..0889a38 100644
--- a/heatclient/osc/v1/template.py
+++ b/heatclient/osc/v1/template.py
@@ -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')