Merge "Override 'savanna' strings in openstack/common"

This commit is contained in:
Jenkins 2014-03-21 21:01:52 +00:00 committed by Gerrit Code Review
commit 0b83f509ed
6 changed files with 13 additions and 13 deletions

View File

@ -88,7 +88,7 @@
#
# The file name to use with SQLite (string value)
#sqlite_db=savanna.sqlite
#sqlite_db=sahara.sqlite
# If True, SQLite uses synchronous mode (boolean value)
#sqlite_synchronous=true

View File

@ -34,7 +34,7 @@ import stevedore.named
from sahara.openstack.common import gettextutils
from sahara.openstack.common import importutils
gettextutils.install('savanna')
gettextutils.install('sahara')
STROPT = "StrOpt"
BOOLOPT = "BoolOpt"
@ -230,7 +230,7 @@ def _sanitize_default(name, value):
elif value == _get_my_ip():
return '10.0.0.1'
elif value in (socket.gethostname(), socket.getfqdn()) and 'host' in name:
return 'savanna'
return 'sahara'
elif value.strip() != value:
return '"%s"' % value
return value

View File

@ -290,7 +290,7 @@ from sahara.openstack.common import timeutils
sqlite_db_opts = [
cfg.StrOpt('sqlite_db',
default='savanna.sqlite',
default='sahara.sqlite',
help='The file name to use with SQLite'),
cfg.BoolOpt('sqlite_synchronous',
default=True,
@ -838,7 +838,7 @@ def _patch_mysqldb_with_stacktrace_comments():
if filename.endswith('db/api.py'):
continue
# only trace inside sahara
index = filename.rfind('savanna')
index = filename.rfind('sahara')
if index == -1:
continue
stack += "File:%s:%s Method:%s() Line:%s | " \

View File

@ -33,15 +33,15 @@ import re
from babel import localedata
import six
_localedir = os.environ.get('savanna'.upper() + '_LOCALEDIR')
_t = gettext.translation('savanna', localedir=_localedir, fallback=True)
_localedir = os.environ.get('sahara'.upper() + '_LOCALEDIR')
_t = gettext.translation('sahara', localedir=_localedir, fallback=True)
# We use separate translation catalogs for each log level, so set up a
# mapping between the log level name and the translator. The domain
# for the log level is project_name + "-log-" + log_level so messages
# for each level end up in their own catalog.
_t_log_levels = dict(
(level, gettext.translation('savanna' + '-log-' + level,
(level, gettext.translation('sahara' + '-log-' + level,
localedir=_localedir,
fallback=True))
for level in ['info', 'warning', 'error', 'critical']
@ -65,7 +65,7 @@ def enable_lazy():
def _(msg):
if USE_LAZY:
return Message(msg, domain='savanna')
return Message(msg, domain='sahara')
else:
if six.PY3:
return _t.gettext(msg)
@ -76,7 +76,7 @@ def _log_translation(msg, level):
"""Build a single translation of a log message
"""
if USE_LAZY:
return Message(msg, domain='savanna' + '-log-' + level)
return Message(msg, domain='sahara' + '-log-' + level)
else:
translator = _t_log_levels[level]
if six.PY3:
@ -153,7 +153,7 @@ class Message(six.text_type):
"""
def __new__(cls, msgid, msgtext=None, params=None,
domain='savanna', *args):
domain='sahara', *args):
"""Create a new Message object.
In order for translation to work gettext requires a message ID, this

View File

@ -59,7 +59,7 @@ def import_module(import_str):
def import_versioned_module(version, submodule=None):
module = 'savanna.v%s' % version
module = 'sahara.v%s' % version
if submodule:
module = '.'.join((module, submodule))
return import_module(module)

View File

@ -537,7 +537,7 @@ def _setup_logging_from_conf(project, version):
if CONF.publish_errors:
handler = importutils.import_object(
"savanna.openstack.common.log_handler.PublishErrorsHandler",
"sahara.openstack.common.log_handler.PublishErrorsHandler",
logging.ERROR)
log_root.addHandler(handler)