Eliminate redundant modules from oslo-incubator

This change is part of a multi-part change set to handle obsolete and
graduated oslo modules. This commit cleans up openstack-common.conf
which has unnecessary entries for middleware and fileutils that are
not required in trove.

Also, trove acquired a trove/openstack/common/utils.py which had two
routines that were long ago moved into strutils (now oslo.utils). The
sole remaining reference to that source file has been updated to
reflect this.

This change is based on https://review.openstack.org/#/c/141081/

Change-Id: I279161ac7b321f306df180a2df20f64e869866b0
Partial-Bug: #1380789
This commit is contained in:
Amrith Kumar 2014-12-11 11:25:54 -05:00 committed by amrith
parent 294ef919a9
commit 25cf51f437
3 changed files with 4 additions and 66 deletions

View File

@ -3,19 +3,15 @@
# The list of modules to copy from oslo-incubator
module=context
module=eventlet_backdoor
module=fileutils
module=local
module=log
module=loopingcall
module=middleware
module=notifier
module=pastedeploy
module=periodic_task
module=policy
module=rpc
module=service
module=threadgroup
module=utils
module=versionutils
# The base module to hold the copy of openstack.common

View File

@ -28,21 +28,22 @@ from passlib import utils as passlib_utils
from oslo.utils import importutils
from oslo.utils import timeutils
from oslo.utils import strutils
from oslo_concurrency import processutils
from trove.common import cfg
from trove.common import exception
from trove.common.i18n import _
from trove.openstack.common import log as logging
from trove.openstack.common import loopingcall
from trove.openstack.common import utils as openstack_utils
from trove.common.i18n import _
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
import_class = importutils.import_class
import_object = importutils.import_object
import_module = importutils.import_module
bool_from_string = openstack_utils.bool_from_string
bool_from_string = strutils.bool_from_string
execute = processutils.execute
isotime = timeutils.isotime

View File

@ -1,59 +0,0 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""
System-level utilities and helper functions.
"""
import logging
LOG = logging.getLogger(__name__)
def int_from_bool_as_string(subject):
"""
Interpret a string as a boolean and return either 1 or 0.
Any string value in:
('True', 'true', 'On', 'on', '1')
is interpreted as a boolean True.
Useful for JSON-decoded stuff and config file parsing
"""
return bool_from_string(subject) and 1 or 0
def bool_from_string(subject):
"""
Interpret a string as a boolean.
Any string value in:
('True', 'true', 'On', 'on', 'Yes', 'yes', '1')
is interpreted as a boolean True.
Useful for JSON-decoded stuff and config file parsing
"""
if isinstance(subject, bool):
return subject
if isinstance(subject, basestring):
if subject.strip().lower() in ('true', 'on', 'yes', '1'):
return True
return False