From 526947d6edda4d0ca1822093513225d960a90eb1 Mon Sep 17 00:00:00 2001 From: zhurong Date: Wed, 19 Oct 2016 16:15:17 +0800 Subject: [PATCH] Remove the openstack/common/cliutils.py to common/cliutils.py The Oslo team has moved all previously incubated code from the openstack/oslo-incubator repository into separate library repositories, so should remove the openstack dir. Change-Id: Id40ce410b00f15b771fec8ee3c65957b7bcd0639 --- contrib/setup-tools/solum-app-setup.py | 2 +- solumclient/common/cli_utils.py | 2 +- solumclient/{openstack => }/common/cliutils.py | 14 ++++++-------- tox.ini | 3 +++ 4 files changed, 11 insertions(+), 10 deletions(-) rename solumclient/{openstack => }/common/cliutils.py (97%) diff --git a/contrib/setup-tools/solum-app-setup.py b/contrib/setup-tools/solum-app-setup.py index 8217942..cf13941 100644 --- a/contrib/setup-tools/solum-app-setup.py +++ b/contrib/setup-tools/solum-app-setup.py @@ -32,7 +32,7 @@ import six import yaml from solumclient import client as solum_client -from solumclient.openstack.common import cliutils +from solumclient.common import cliutils SOLUM_API_VERSION = '1' diff --git a/solumclient/common/cli_utils.py b/solumclient/common/cli_utils.py index ce854fc..209b70b 100644 --- a/solumclient/common/cli_utils.py +++ b/solumclient/common/cli_utils.py @@ -19,8 +19,8 @@ import os from oslo_log import log as logging from solumclient import client as solum_client +from solumclient.common import cliutils from solumclient.common import exc -from solumclient.openstack.common import cliutils class CommandsBase(object): diff --git a/solumclient/openstack/common/cliutils.py b/solumclient/common/cliutils.py similarity index 97% rename from solumclient/openstack/common/cliutils.py rename to solumclient/common/cliutils.py index 10157aa..5746ddc 100644 --- a/solumclient/openstack/common/cliutils.py +++ b/solumclient/common/cliutils.py @@ -279,18 +279,16 @@ def find_resource(manager, name_or_id, **find_args): return manager.find(**kwargs) except exceptions.NotFound: msg = _("No %(name)s with a name or " - "ID of '%(name_or_id)s' exists.") % \ - { - "name": manager.resource_class.__name__.lower(), - "name_or_id": name_or_id + "ID of '%(name_or_id)s' exists.") % { + "name": manager.resource_class.__name__.lower(), + "name_or_id": name_or_id } raise exceptions.CommandError(msg) except exceptions.NoUniqueMatch: msg = _("Multiple %(name)s matches found for " - "'%(name_or_id)s', use an ID to be more specific.") % \ - { - "name": manager.resource_class.__name__.lower(), - "name_or_id": name_or_id + "'%(name_or_id)s', use an ID to be more specific.") % { + "name": manager.resource_class.__name__.lower(), + "name_or_id": name_or_id } raise exceptions.CommandError(msg) diff --git a/tox.ini b/tox.ini index 3e2877f..3d050b6 100644 --- a/tox.ini +++ b/tox.ini @@ -38,3 +38,6 @@ show-source = True ignore = E123,E125,H803 builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build + +[hacking] +import_exceptions = solumclient.i18n