From 5a03ff2b42683d32f6fe7b6c54ea7e788dd5e83a Mon Sep 17 00:00:00 2001 From: Jia Dong Date: Fri, 17 Jan 2014 14:36:35 +0800 Subject: Using common methods from oslo cliutils There are some common methods in cliutils we can use in ceilometerclient: arg, env, unauthenticated, isunauthenticated. + Replaces utils.env to add alias env from cliutils. + Removes unused methods in utils: env To use methods from clituils. partially implements blueprint common-client-library-2 Change-Id: I295cc80635ed15c91e2832acb315e9deede09516 --- ceilometerclient/common/utils.py | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'ceilometerclient/common/utils.py') diff --git a/ceilometerclient/common/utils.py b/ceilometerclient/common/utils.py index 3d7b0cd..aa31721 100644 --- a/ceilometerclient/common/utils.py +++ b/ceilometerclient/common/utils.py @@ -14,7 +14,6 @@ # under the License. from __future__ import print_function -import os import six import sys import textwrap @@ -133,19 +132,6 @@ def find_resource(manager, name_or_id): raise exc.CommandError(msg) -def env(*vars, **kwargs): - """Search for the first defined of possibly many env vars - - Returns the first environment variable defined in vars, or - returns the default defined in kwargs. - """ - for v in vars: - value = os.environ.get(v, None) - if value: - return value - return kwargs.get('default', '') - - def import_versioned_module(version, submodule=None): module = 'ceilometerclient.v%s' % version if submodule: -- cgit v1.2.1