From: Zane Bitter Date: Fri, 7 Dec 2012 14:36:54 +0000 (+0100) Subject: Get rid of leftover heat-jeos code in utils X-Git-Tag: 2014.1~1112 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d7437715af4a7b440ab9760e2eb089f4150d5819;p=openstack-build%2Fheat-build.git Get rid of leftover heat-jeos code in utils This code, including the Glance client dependency, was left over from when what is now heat-jeos was part of the heat codebase. Change-Id: I35081fb7911ad1ea3284cbb6e3f83dd8c6a1807f Signed-off-by: Zane Bitter --- diff --git a/heat/utils.py b/heat/utils.py index bc39b6cf..d494b927 100644 --- a/heat/utils.py +++ b/heat/utils.py @@ -13,61 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -import functools -import os -import os.path -import sys -import base64 -from lxml import etree -import re - -try: - from glanceclient import client as glance_client -except ImportError: - from glance import client as glance_client -from heat.common import exception - -from heat.openstack.common import log as logging - -LOG = logging.getLogger(__name__) - -SUCCESS = 0 -FAILURE = 1 - - -def catch_error(action): - """Decorator to provide sensible default error handling for CLI actions.""" - def wrap(func): - @functools.wraps(func) - def wrapper(*arguments, **kwargs): - try: - ret = func(*arguments, **kwargs) - return SUCCESS if ret is None else ret - except exception.NotAuthorized: - LOG.error("Not authorized to make this request. Check " + - "your credentials (OS_USERNAME, OS_PASSWORD, " + - "OS_TENANT_NAME, OS_AUTH_URL and OS_AUTH_STRATEGY).") - return FAILURE - except exception.ClientConfigurationError: - raise - except exception.KeystoneError, e: - LOG.error("Keystone did not finish the authentication and " - "returned the following message:\n\n%s" - % e.message) - return FAILURE - except Exception, e: - options = arguments[0] - if options.debug: - raise - LOG.error("Failed to %s. Got error:" % action) - pieces = unicode(e).split('\n') - for piece in pieces: - LOG.error(piece) - return FAILURE - - return wrapper - return wrap - class LazyPluggable(object): """A pluggable backend loaded lazily based on some value."""