From f1c9930436b17c800f11cfbccd5399fc847ca8d5 Mon Sep 17 00:00:00 2001 From: Tang Chen Date: Fri, 24 Jun 2016 10:31:42 +0800 Subject: [PATCH] Use osc-lib instead of openstackclient osc-lib is a package of common support modules for writing OSC plugins. All common functions, classes such as exceptions, utils, logs and so on have been moved from openstackclient to osc-lib. So use osc-lib instead of openstackclient. Change-Id: I14323d43d0e5b41ce0611590f5f6a375cdc3dc2d --- heatclient/osc/plugin.py | 2 +- heatclient/osc/v1/build_info.py | 2 +- heatclient/osc/v1/event.py | 2 +- heatclient/osc/v1/resource.py | 6 +++--- heatclient/osc/v1/resource_type.py | 4 ++-- heatclient/osc/v1/service.py | 2 +- heatclient/osc/v1/snapshot.py | 6 +++--- heatclient/osc/v1/software_config.py | 4 ++-- heatclient/osc/v1/software_deployment.py | 4 ++-- heatclient/osc/v1/stack.py | 6 +++--- heatclient/osc/v1/template.py | 2 +- heatclient/tests/unit/osc/v1/test_resource.py | 2 +- heatclient/tests/unit/osc/v1/test_resource_type.py | 2 +- heatclient/tests/unit/osc/v1/test_snapshot.py | 2 +- heatclient/tests/unit/osc/v1/test_software_config.py | 2 +- heatclient/tests/unit/osc/v1/test_software_deployment.py | 2 +- heatclient/tests/unit/osc/v1/test_stack.py | 4 ++-- requirements.txt | 1 + 18 files changed, 28 insertions(+), 27 deletions(-) diff --git a/heatclient/osc/plugin.py b/heatclient/osc/plugin.py index 7939c79e..4fea6d3a 100644 --- a/heatclient/osc/plugin.py +++ b/heatclient/osc/plugin.py @@ -13,7 +13,7 @@ import logging -from openstackclient.common import utils +from osc_lib import utils LOG = logging.getLogger(__name__) diff --git a/heatclient/osc/v1/build_info.py b/heatclient/osc/v1/build_info.py index 11dead55..e8ded764 100644 --- a/heatclient/osc/v1/build_info.py +++ b/heatclient/osc/v1/build_info.py @@ -17,7 +17,7 @@ import logging import six from cliff import show -from openstackclient.common import utils +from osc_lib import utils from heatclient.common import utils as heat_utils diff --git a/heatclient/osc/v1/event.py b/heatclient/osc/v1/event.py index 233b3ed7..0dc18847 100644 --- a/heatclient/osc/v1/event.py +++ b/heatclient/osc/v1/event.py @@ -18,7 +18,7 @@ import time from cliff.formatters import base from cliff import lister from cliff import show -from openstackclient.common import utils +from osc_lib import utils from heatclient.common import event_utils from heatclient.common import utils as heat_utils diff --git a/heatclient/osc/v1/resource.py b/heatclient/osc/v1/resource.py index 54f9302f..381a377e 100644 --- a/heatclient/osc/v1/resource.py +++ b/heatclient/osc/v1/resource.py @@ -20,9 +20,9 @@ from six.moves.urllib import request from cliff import lister from cliff import show -from openstackclient.common import exceptions as exc -from openstackclient.common import utils -from openstackclient.i18n import _ +from osc_lib import exceptions as exc +from osc_lib.i18n import _ +from osc_lib import utils from oslo_serialization import jsonutils from heatclient.common import format_utils diff --git a/heatclient/osc/v1/resource_type.py b/heatclient/osc/v1/resource_type.py index 3fafbb45..265ac989 100644 --- a/heatclient/osc/v1/resource_type.py +++ b/heatclient/osc/v1/resource_type.py @@ -20,8 +20,8 @@ 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 openstackclient.common import exceptions as exc -from openstackclient.i18n import _ +from osc_lib import exceptions as exc +from osc_lib.i18n import _ class ResourceTypeShow(format_utils.YamlFormat): diff --git a/heatclient/osc/v1/service.py b/heatclient/osc/v1/service.py index 57c8cf0b..1a1ae45e 100644 --- a/heatclient/osc/v1/service.py +++ b/heatclient/osc/v1/service.py @@ -16,7 +16,7 @@ import logging from cliff import lister -from openstackclient.common import utils +from osc_lib import utils class ListService(lister.Lister): diff --git a/heatclient/osc/v1/snapshot.py b/heatclient/osc/v1/snapshot.py index a46d31ad..449b94b4 100644 --- a/heatclient/osc/v1/snapshot.py +++ b/heatclient/osc/v1/snapshot.py @@ -19,12 +19,12 @@ import six from cliff import command from cliff import lister from cliff import show -from openstackclient.common import exceptions as exc -from openstackclient.common import utils +from osc_lib import exceptions as exc +from osc_lib.i18n import _ +from osc_lib import utils from heatclient.common import format_utils from heatclient import exc as heat_exc -from openstackclient.i18n import _ class ListSnapshot(lister.Lister): diff --git a/heatclient/osc/v1/software_config.py b/heatclient/osc/v1/software_config.py index d3d31587..4e2beb3a 100644 --- a/heatclient/osc/v1/software_config.py +++ b/heatclient/osc/v1/software_config.py @@ -21,8 +21,8 @@ import yaml from cliff import command from cliff import lister -from openstackclient.common import exceptions as exc -from openstackclient.common import utils +from osc_lib import exceptions as exc +from osc_lib import utils from heatclient.common import format_utils from heatclient.common import template_format diff --git a/heatclient/osc/v1/software_deployment.py b/heatclient/osc/v1/software_deployment.py index 983837a3..ff33c8d9 100644 --- a/heatclient/osc/v1/software_deployment.py +++ b/heatclient/osc/v1/software_deployment.py @@ -20,8 +20,8 @@ from cliff import command from cliff import lister from cliff import show -from openstackclient.common import exceptions as exc -from openstackclient.common import utils +from osc_lib import exceptions as exc +from osc_lib import utils from heatclient.common import deployment_utils from heatclient.common import format_utils diff --git a/heatclient/osc/v1/stack.py b/heatclient/osc/v1/stack.py index c845ee0f..cb3f55d8 100644 --- a/heatclient/osc/v1/stack.py +++ b/heatclient/osc/v1/stack.py @@ -19,9 +19,9 @@ import sys from cliff import command from cliff import lister from cliff import show -from openstackclient.common import exceptions as exc -from openstackclient.common import parseractions -from openstackclient.common import utils +from osc_lib.cli import parseractions +from osc_lib import exceptions as exc +from osc_lib import utils from oslo_serialization import jsonutils import six from six.moves.urllib import request diff --git a/heatclient/osc/v1/template.py b/heatclient/osc/v1/template.py index 36f6ca99..58301812 100644 --- a/heatclient/osc/v1/template.py +++ b/heatclient/osc/v1/template.py @@ -17,7 +17,7 @@ import six from cliff import lister -from openstackclient.common import utils +from osc_lib import utils from heatclient.common import format_utils from heatclient.common import http diff --git a/heatclient/tests/unit/osc/v1/test_resource.py b/heatclient/tests/unit/osc/v1/test_resource.py index 5193cb8e..4fc29abf 100644 --- a/heatclient/tests/unit/osc/v1/test_resource.py +++ b/heatclient/tests/unit/osc/v1/test_resource.py @@ -14,7 +14,7 @@ import copy import mock -from openstackclient.common import exceptions as exc +from osc_lib import exceptions as exc from heatclient import exc as heat_exc from heatclient.osc.v1 import resource diff --git a/heatclient/tests/unit/osc/v1/test_resource_type.py b/heatclient/tests/unit/osc/v1/test_resource_type.py index 738915dc..b972cb95 100644 --- a/heatclient/tests/unit/osc/v1/test_resource_type.py +++ b/heatclient/tests/unit/osc/v1/test_resource_type.py @@ -11,7 +11,7 @@ # under the License. # -from openstackclient.common import exceptions as exc +from osc_lib import exceptions as exc from heatclient import exc as heat_exc from heatclient.osc.v1 import resource_type diff --git a/heatclient/tests/unit/osc/v1/test_snapshot.py b/heatclient/tests/unit/osc/v1/test_snapshot.py index 47683bbd..f51a6ed3 100644 --- a/heatclient/tests/unit/osc/v1/test_snapshot.py +++ b/heatclient/tests/unit/osc/v1/test_snapshot.py @@ -11,7 +11,7 @@ # under the License. # -from openstackclient.common import exceptions as exc +from osc_lib import exceptions as exc from heatclient import exc as heat_exc from heatclient.osc.v1 import snapshot diff --git a/heatclient/tests/unit/osc/v1/test_software_config.py b/heatclient/tests/unit/osc/v1/test_software_config.py index 4a60f39f..4bdf0bd2 100644 --- a/heatclient/tests/unit/osc/v1/test_software_config.py +++ b/heatclient/tests/unit/osc/v1/test_software_config.py @@ -14,7 +14,7 @@ import mock import yaml -from openstackclient.common import exceptions as exc +from osc_lib import exceptions as exc from heatclient import exc as heat_exc from heatclient.osc.v1 import software_config diff --git a/heatclient/tests/unit/osc/v1/test_software_deployment.py b/heatclient/tests/unit/osc/v1/test_software_deployment.py index dc4c214b..76bc3cfb 100644 --- a/heatclient/tests/unit/osc/v1/test_software_deployment.py +++ b/heatclient/tests/unit/osc/v1/test_software_deployment.py @@ -14,7 +14,7 @@ import copy import mock -from openstackclient.common import exceptions as exc +from osc_lib import exceptions as exc from heatclient import exc as heat_exc from heatclient.osc.v1 import software_deployment diff --git a/heatclient/tests/unit/osc/v1/test_stack.py b/heatclient/tests/unit/osc/v1/test_stack.py index 46ab7d5f..ccad59a8 100644 --- a/heatclient/tests/unit/osc/v1/test_stack.py +++ b/heatclient/tests/unit/osc/v1/test_stack.py @@ -18,8 +18,8 @@ import six import testscenarios import yaml -from openstackclient.common import exceptions as exc -from openstackclient.common import utils +from osc_lib import exceptions as exc +from osc_lib import utils from heatclient.common import template_format from heatclient import exc as heat_exc diff --git a/requirements.txt b/requirements.txt index aacc35fd..9376c4c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ Babel>=2.3.4 # BSD pbr>=1.6 # Apache-2.0 cliff!=1.16.0,!=1.17.0,>=1.15.0 # Apache-2.0 iso8601>=0.1.11 # MIT +osc-lib>=0.1.0 # Apache-2.0 PrettyTable<0.8,>=0.7 # BSD oslo.i18n>=2.1.0 # Apache-2.0 oslo.serialization>=1.10.0 # Apache-2.0