Make some refactoring

Specify valid names
Add translation where it's possiable
Specify exception types`

Change-Id: I31a47254494ad6d574c6d7ce393e24a1ba2383d2
This commit is contained in:
Ekaterina Fedorova 2014-01-14 16:02:17 +04:00
parent f9f8bcf6dd
commit 3b8e8734f6
9 changed files with 1056 additions and 70 deletions

View File

@ -30,7 +30,7 @@ def reset_cache():
os.mkdir(cache_dir)
except:
log.exception(_('Error while cleaning cache'))
return make_response('Unable to reset cache', 500)
return make_response(_('Unable to reset cache'), 500)
def compose_path(data_type, path=None):
@ -94,10 +94,10 @@ def save_file(request, data_type, path=None, filename=None):
if request.content_type == 'application/octet-stream':
data = request.environ['wsgi.input'].read()
if not data:
return make_response('No file to upload', 400)
return make_response(_('No file to upload'), 400)
if not filename:
return make_response("'filename' should be in request arguments",
400)
return make_response(_("'filename' should be in "
"request arguments"), 400)
with tempfile.NamedTemporaryFile(delete=False) as uploaded_file:
uploaded_file.write(data)
@ -114,7 +114,7 @@ def save_file(request, data_type, path=None, filename=None):
abort(403)
file_to_upload.save(path_to_file)
else:
return make_response('No file to upload', 400)
return make_response(_('No file to upload'), 400)
reset_cache()
return jsonify(result='success')
@ -155,19 +155,19 @@ def perform_deletion(files_for_deletion, manifest_for_deletion):
backup_dir = os.path.join(
utils.get_cache_folder(),
'Backup_{0}'.format(datetime.datetime.utcnow()))
log.debug('Creating service data backup to {0}'.format(backup_dir))
log.debug(_('Creating service data backup to {0}'.format(backup_dir)))
shutil.copytree(utils.get_tenant_folder(), backup_dir)
return backup_dir
def release_backup(backup):
try:
shutil.rmtree(backup, ignore_errors=True)
except Exception:
except OSError:
log.exception(_('Release Backup: '
'Backup {0} deletion failed'.format(backup)))
def restore_backup(backup):
log.debug('Restore service data after unsuccessful deletion')
log.debug(_('Restore service data after unsuccessful deletion'))
shutil.rmtree(utils.get_tenant_folder(), ignore_errors=True)
os.rename(backup, utils.get_tenant_folder())
@ -186,10 +186,10 @@ def perform_deletion(files_for_deletion, manifest_for_deletion):
for file in files:
path_to_delete = os.path.join(data_type_dir, file)
if os.path.exists(path_to_delete):
log.debug('Delete {0}: Removing {1} file'.format(
service_name, path_to_delete))
log.debug(_('Delete {0}: Removing {1} file'.format(
service_name, path_to_delete)))
os.remove(path_to_delete)
except Exception:
except:
log.exception(_('Deleting operation failed'))
restore_backup(backup_dir)
abort(500)
@ -200,7 +200,7 @@ def perform_deletion(files_for_deletion, manifest_for_deletion):
def save_archive(request):
err_resp = make_response('There is no data to upload', 400)
err_resp = make_response(_('There is no data to upload'), 400)
if request.content_type == 'application/octet-stream':
data = request.environ['wsgi.input'].read()
if not data:
@ -230,8 +230,8 @@ def create_or_update_service(service_id, data):
for parameter in required:
if not data.get(parameter):
return make_response('There is no {parameter} in json'.format(
parameter=parameter), 400)
return make_response(_('There is no {parameter} in json'.format(
parameter=parameter)), 400)
for parameter in optional.keys():
if not data.get(parameter):
data[parameter] = optional[parameter]
@ -248,12 +248,12 @@ def create_or_update_service(service_id, data):
try:
with open(path_to_manifest, 'w') as service_manifest:
service_manifest.write(serialize(data))
except Exception:
except:
log.exception(_('Unable to write to service '
'manifest file {0}'.format(path_to_manifest)))
if backup_done:
shutil.move(backup.name, path_to_manifest)
elif os.path.exists(path_to_manifest):
os.remove(path_to_manifest)
return make_response('Error during service manifest creation', 500)
return make_response(_('Error during service manifest creation'), 500)
return jsonify(result='success')

View File

@ -18,7 +18,7 @@ import json
from flask import Blueprint, send_file
from flask import jsonify, request, abort
from flask import make_response
from muranorepository.api import utils as api
from muranorepository.api import utils as api_utils
from muranorepository.utils.parser import ManifestParser
from muranorepository.utils.archiver import Archiver
from muranorepository.consts import DATA_TYPES, MANIFEST
@ -34,8 +34,8 @@ CONF = cfg.CONF
def get_archive_data(client_type):
if client_type not in CLIENTS_DICT.keys():
abort(404)
path_to_archive = api.get_archive(client_type,
request.args.get('hash'))
path_to_archive = api_utils.get_archive(client_type,
request.args.get('hash'))
if path_to_archive:
return send_file(path_to_archive, mimetype='application/octet-stream')
else:
@ -45,14 +45,15 @@ def get_archive_data(client_type):
@v1_api.route('/client/services/<service_name>')
def download_service_archive(service_name):
# In the future service name may contains dots
api.check_service_name(service_name)
api_utils.check_service_name(service_name)
manifests = ManifestParser().parse()
services_for_download = [manifest for manifest in manifests
if manifest.full_service_name == service_name]
if not services_for_download:
abort(404)
if len(services_for_download) != 1:
return make_response('Fully qualified service name is not unique', 500)
return make_response(_('Fully qualified service name is not unique'),
500)
archive_manager = Archiver(dst_by_data_type=True)
#ToDo: Create new class to prevent opening twice the same file for writing
with tempfile.NamedTemporaryFile() as tempf:
@ -60,80 +61,87 @@ def download_service_archive(service_name):
file = archive_manager.create_service_archive(
services_for_download[0], tempf.name)
except:
log.error(_('Unable to create service archive'))
log.exception(_('Unable to create service archive'))
abort(500)
return send_file(file, mimetype='application/octet-stream')
@v1_api.route('/admin/<data_type>')
def get_data_type_locations(data_type):
api.check_data_type(data_type)
result_path = api.compose_path(data_type)
return api.get_locations(data_type, result_path)
api_utils.check_data_type(data_type)
result_path = api_utils.compose_path(data_type)
return api_utils.get_locations(data_type, result_path)
@v1_api.route('/admin/<data_type>', methods=['POST'])
def upload_file(data_type):
api.check_data_type(data_type)
api_utils.check_data_type(data_type)
filename = request.args.get('filename')
return api.save_file(request, data_type, path=None, filename=filename)
return api_utils.save_file(request, data_type,
path=None, filename=filename)
@v1_api.route('/admin/<data_type>/<path:path>')
def get_locations_in_nested_path_or_get_file(data_type, path):
api.check_data_type(data_type)
result_path = api.compose_path(data_type, path)
api_utils.check_data_type(data_type)
result_path = api_utils.compose_path(data_type, path)
if os.path.isfile(result_path):
return send_file(result_path, mimetype='application/octet-stream')
else:
return api.get_locations(data_type, result_path)
return api_utils.get_locations(data_type, result_path)
@v1_api.route('/admin/<data_type>/<path:path>', methods=['POST'])
def upload_file_in_nested_path(data_type, path):
api.check_data_type(data_type)
api_utils.check_data_type(data_type)
if data_type == MANIFEST:
make_response('It is forbidden to upload manifests to subfolders',
make_response(_('It is forbidden to upload manifests to subfolders'),
403)
return api.save_file(request, data_type, path)
return api_utils.save_file(request, data_type, path)
@v1_api.route('/admin/<data_type>/<path:path>', methods=['PUT'])
def create_dirs(data_type, path):
api.check_data_type(data_type)
result_path = api.compose_path(data_type, path)
api_utils.check_data_type(data_type)
result_path = api_utils.compose_path(data_type, path)
resp = jsonify(result='success')
if os.path.exists(result_path):
return resp
if data_type == MANIFEST:
make_response('It is forbidden to create '
'directories for manifest files', 403)
make_response(_('It is forbidden to create '
'directories for manifest files'), 403)
try:
os.makedirs(result_path)
except Exception:
except OSError:
log.exception(_("Error during creating folders"))
abort(403)
return resp
@v1_api.route('/admin/<data_type>/<path:path>', methods=['DELETE'])
def delete_directory_or_file(data_type, path):
api.check_data_type(data_type)
result_path = api.compose_path(data_type, path)
api_utils.check_data_type(data_type)
result_path = api_utils.compose_path(data_type, path)
if not os.path.exists(result_path):
log.info(_("Attempt to delete '{0}' failed:"
"specified path doesn't exist"))
abort(404)
if os.path.isfile(result_path):
try:
os.remove(result_path)
except Exception:
except OSError:
log.exception(_("Something went wrong during deletion"
" '{0}' file".format(result_path)))
abort(500)
else:
try:
# enable to delete only empty directories
os.rmdir(result_path)
except Exception:
make_response('Directory must be empty to be deleted', 403)
api.reset_cache()
except OSError:
make_response(_('Directory must be empty to be deleted'),
403)
api_utils.reset_cache()
return jsonify(result='success')
@ -151,76 +159,79 @@ def get_services_list():
@v1_api.route('/admin/services/<service_name>')
def get_files_for_service(service_name):
api.check_service_name(service_name)
api_utils.check_service_name(service_name)
manifest = ManifestParser().parse_manifest(service_name)
if not manifest:
abort(404)
data = api.get_manifest_files(manifest)
data = api_utils.get_manifest_files(manifest)
return jsonify(data)
@v1_api.route('/admin/services/<service_name>/info')
def get_service_info(service_name):
api.check_service_name(service_name)
api_utils.check_service_name(service_name)
manifest = ManifestParser().parse_manifest(service_name)
if not manifest:
abort(404)
data = api.get_manifest_info(manifest)
data = api_utils.get_manifest_info(manifest)
return jsonify(data)
@v1_api.route('/admin/services', methods=['POST'])
def upload_new_service():
path_to_archive = api.save_archive(request)
path_to_archive = api_utils.save_archive(request)
if not tarfile.is_tarfile(path_to_archive):
return make_response('Uploading file should be a tar.gz archive', 400)
return make_response(_('Uploading file should be a tar.gz archive'),
400)
archive_manager = Archiver()
result = archive_manager.extract(path_to_archive)
if result:
api.reset_cache()
api_utils.reset_cache()
return jsonify(result='success')
else:
return make_response('Uploading file failed.', 400)
return make_response(_('Uploading file failed.'), 400)
@v1_api.route('/admin/services/<service_name>', methods=['DELETE'])
def delete_service(service_name):
api.check_service_name(service_name)
api_utils.check_service_name(service_name)
manifests = ManifestParser().parse()
manifest_for_deletion = None
# Search for manifest to delete
for manifest in manifests:
if manifest.full_service_name == service_name:
manifest_for_deletion = manifest
files_for_deletion = api.get_manifest_files(manifest_for_deletion)
files_for_deletion = api_utils.get_manifest_files(
manifest_for_deletion)
manifests.remove(manifest_for_deletion)
break
if not manifest_for_deletion:
abort(404)
files_for_deletion = api.exclude_common_files(files_for_deletion,
manifests)
files_for_deletion = api_utils.exclude_common_files(files_for_deletion,
manifests)
return api.perform_deletion(files_for_deletion, manifest_for_deletion)
return api_utils.perform_deletion(files_for_deletion,
manifest_for_deletion)
@v1_api.route('/admin/services/<service_name>/toggle_enabled',
methods=['POST'])
def toggleEnabled(service_name):
api.check_service_name(service_name)
api_utils.check_service_name(service_name)
parser = ManifestParser()
result = parser.toggle_enabled(service_name)
if result:
api.reset_cache()
api_utils.reset_cache()
return jsonify(result='success')
else:
return make_response('Unable to toggle '
'enable parameter for specified service', 500)
return make_response(_('Unable to toggle '
'enable parameter for specified service'), 500)
@v1_api.route('/admin/reset_caches', methods=['POST'])
def reset_caches():
api.reset_cache()
api_utils.reset_cache()
return jsonify(result='success')
@ -235,9 +246,9 @@ def create_or_update_service(service_name):
#TODO: Pass service_name instead of service_id
if not service_id or service_id != service_name:
return make_response(
"Body attribute 'full_service_name' value is {0} which doesn't "
"correspond to 'service_name' part of URL (equals to {1})".format(
service_id, service_name), 400)
resp = api.create_or_update_service(service_name, service_data)
api.reset_cache()
_("Body attribute 'full_service_name' value is {0} which doesn't "
"correspond to 'service_name' part of URL "
"(equals to {1})".format(service_id, service_name)), 400)
resp = api_utils.create_or_update_service(service_name, service_data)
api_utils.reset_cache()
return resp

View File

@ -0,0 +1 @@
[python: **.py]

View File

@ -21,6 +21,7 @@ import eventlet
import tempfile
from eventlet import wsgi
from oslo.config import cfg
import gettext
# If ../murano_service/__init__.py exists, add ../ to Python search path,
# so that it will override what happens to be installed in
# /usr/(local/)lib/python...
@ -33,6 +34,9 @@ if os.path.exists(os.path.join(possible_topdir,
'__init__.py')):
sys.path.insert(0, possible_topdir)
gettext.install('muranorepository', unicode=1)
from muranorepository import config
import muranorepository.main as server
from muranorepository.openstack.common import log

View File

@ -0,0 +1 @@
Murano-repository translations

View File

@ -0,0 +1,969 @@
# Translations template for murano-repository.
# Copyright (C) 2014 ORGANIZATION
# This file is distributed under the same license as the murano-repository
# project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: murano-repository 0.4.dev158.g691b17a\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2014-01-15 14:48+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
#: muranorepository/api/utils.py:31
msgid "Error while cleaning cache"
msgstr ""
#: muranorepository/api/utils.py:32
msgid "Unable to reset cache"
msgstr ""
#: muranorepository/api/utils.py:54
msgid "Transferring existing archive"
msgstr ""
#: muranorepository/api/utils.py:96 muranorepository/api/utils.py:116
msgid "No file to upload"
msgstr ""
#: muranorepository/api/utils.py:98
msgid "'filename' should be in request arguments"
msgstr ""
#: muranorepository/api/utils.py:157
msgid "Creating service data backup to {0}"
msgstr ""
#: muranorepository/api/utils.py:166
msgid "Release Backup: Backup {0} deletion failed"
msgstr ""
#: muranorepository/api/utils.py:169
msgid "Restore service data after unsuccessful deletion"
msgstr ""
#: muranorepository/api/utils.py:179
msgid "Deleting manifest file {0}"
msgstr ""
#: muranorepository/api/utils.py:188
msgid "Delete {0}: Removing {1} file"
msgstr ""
#: muranorepository/api/utils.py:192
msgid "Deleting operation failed"
msgstr ""
#: muranorepository/api/utils.py:202
msgid "There is no data to upload"
msgstr ""
#: muranorepository/api/utils.py:229
msgid "There is no {parameter} in json"
msgstr ""
#: muranorepository/api/utils.py:249
msgid "Unable to write to service manifest file {0}"
msgstr ""
#: muranorepository/api/utils.py:254
msgid "Error during service manifest creation"
msgstr ""
#: muranorepository/api/v1.py:55
msgid "Fully qualified service name is not unique"
msgstr ""
#: muranorepository/api/v1.py:64
msgid "Unable to create service archive"
msgstr ""
#: muranorepository/api/v1.py:99
msgid "It is forbidden to upload manifests to subfolders"
msgstr ""
#: muranorepository/api/v1.py:112
msgid "It is forbidden to create directories for manifest files"
msgstr ""
#: muranorepository/api/v1.py:117
msgid "Error during creating folders"
msgstr ""
#: muranorepository/api/v1.py:127
msgid "Attempt to delete '{0}' failed:specified path doesn't exist"
msgstr ""
#: muranorepository/api/v1.py:135
msgid "Something went wrong during deletion '{0}' file"
msgstr ""
#: muranorepository/api/v1.py:142
msgid "Directory must be empty to be deleted"
msgstr ""
#: muranorepository/api/v1.py:184
msgid "Uploading file should be a tar.gz archive"
msgstr ""
#: muranorepository/api/v1.py:192
msgid "Uploading file failed."
msgstr ""
#: muranorepository/api/v1.py:228
msgid "Unable to toggle enable parameter for specified service"
msgstr ""
#: muranorepository/api/v1.py:251
msgid ""
"Body attribute 'full_service_name' value is {0} which doesn't correspond "
"to 'service_name' part of URL (equals to {1})"
msgstr ""
#: muranorepository/openstack/common/eventlet_backdoor.py:141
#, python-format
msgid "Eventlet backdoor listening on %(port)s for process %(pid)d"
msgstr ""
#: muranorepository/openstack/common/exception.py:103
msgid "Uncaught exception"
msgstr ""
#: muranorepository/openstack/common/excutils.py:64
#, python-format
msgid "Original exception being dropped: %s"
msgstr ""
#: muranorepository/openstack/common/excutils.py:93
#, python-format
msgid "Unexpected exception occurred %d time(s)... retrying."
msgstr ""
#: muranorepository/openstack/common/fileutils.py:64
#, python-format
msgid "Reloading cached file %s"
msgstr ""
#: muranorepository/openstack/common/lockutils.py:100
#, python-format
msgid "Could not release the acquired lock `%s`"
msgstr ""
#: muranorepository/openstack/common/lockutils.py:167
#, python-format
msgid "Got semaphore \"%(lock)s\""
msgstr ""
#: muranorepository/openstack/common/lockutils.py:176
#, python-format
msgid "Attempting to grab file lock \"%(lock)s\""
msgstr ""
#: muranorepository/openstack/common/lockutils.py:186
#, python-format
msgid "Created lock path: %s"
msgstr ""
#: muranorepository/openstack/common/lockutils.py:204
#, python-format
msgid "Got file lock \"%(lock)s\" at %(path)s"
msgstr ""
#: muranorepository/openstack/common/lockutils.py:208
#, python-format
msgid "Released file lock \"%(lock)s\" at %(path)s"
msgstr ""
#: muranorepository/openstack/common/lockutils.py:245
#, python-format
msgid "Got semaphore / lock \"%(function)s\""
msgstr ""
#: muranorepository/openstack/common/lockutils.py:249
#, python-format
msgid "Semaphore / lock released \"%(function)s\""
msgstr ""
#: muranorepository/openstack/common/log.py:244
#, python-format
msgid "Deprecated: %s"
msgstr ""
#: muranorepository/openstack/common/log.py:343
#, python-format
msgid "Error loading logging config %(log_config)s: %(err_msg)s"
msgstr ""
#: muranorepository/openstack/common/log.py:393
#, python-format
msgid "syslog facility must be one of: %s"
msgstr ""
#: muranorepository/openstack/common/log.py:564
#, python-format
msgid "Fatal call to deprecated config: %(msg)s"
msgstr ""
#: muranorepository/openstack/common/loopingcall.py:84
#, python-format
msgid "task run outlasted interval by %s sec"
msgstr ""
#: muranorepository/openstack/common/loopingcall.py:91
msgid "in fixed duration looping call"
msgstr ""
#: muranorepository/openstack/common/loopingcall.py:131
#, python-format
msgid "Dynamic looping call sleeping for %.02f seconds"
msgstr ""
#: muranorepository/openstack/common/loopingcall.py:138
msgid "in dynamic looping call"
msgstr ""
#: muranorepository/openstack/common/periodic_task.py:42
#, python-format
msgid "Unexpected argument for periodic task creation: %(arg)s."
msgstr ""
#: muranorepository/openstack/common/periodic_task.py:133
#, python-format
msgid "Skipping periodic task %(task)s because its interval is negative"
msgstr ""
#: muranorepository/openstack/common/periodic_task.py:138
#, python-format
msgid "Skipping periodic task %(task)s because it is disabled"
msgstr ""
#: muranorepository/openstack/common/periodic_task.py:176
#, python-format
msgid "Running periodic task %(full_task_name)s"
msgstr ""
#: muranorepository/openstack/common/periodic_task.py:185
#, python-format
msgid "Error during %(full_task_name)s: %(e)s"
msgstr ""
#: muranorepository/openstack/common/processutils.py:132
#, python-format
msgid "Got unknown keyword args to utils.execute: %r"
msgstr ""
#: muranorepository/openstack/common/processutils.py:147
#, python-format
msgid "Running cmd (subprocess): %s"
msgstr ""
#: muranorepository/openstack/common/processutils.py:172
#: muranorepository/openstack/common/processutils.py:244
#, python-format
msgid "Result was %s"
msgstr ""
#: muranorepository/openstack/common/processutils.py:184
#, python-format
msgid "%r failed. Retrying."
msgstr ""
#: muranorepository/openstack/common/processutils.py:223
#, python-format
msgid "Running cmd (SSH): %s"
msgstr ""
#: muranorepository/openstack/common/processutils.py:225
msgid "Environment not supported over SSH"
msgstr ""
#: muranorepository/openstack/common/processutils.py:229
msgid "process_input not supported over SSH"
msgstr ""
#: muranorepository/openstack/common/service.py:136
#: muranorepository/openstack/common/service.py:346
msgid "Full set of CONF:"
msgstr ""
#: muranorepository/openstack/common/service.py:143
#: muranorepository/openstack/common/service.py:231
#, python-format
msgid "Caught %s, exiting"
msgstr ""
#: muranorepository/openstack/common/service.py:155
msgid "Exception during rpc cleanup."
msgstr ""
#: muranorepository/openstack/common/service.py:200
msgid "Parent process has died unexpectedly, exiting"
msgstr ""
#: muranorepository/openstack/common/service.py:237
msgid "Unhandled exception"
msgstr ""
#: muranorepository/openstack/common/service.py:270
msgid "Forking too fast, sleeping"
msgstr ""
#: muranorepository/openstack/common/service.py:289
#, python-format
msgid "Started child %d"
msgstr ""
#: muranorepository/openstack/common/service.py:299
#, python-format
msgid "Starting %d workers"
msgstr ""
#: muranorepository/openstack/common/service.py:316
#, python-format
msgid "Child %(pid)d killed by signal %(sig)d"
msgstr ""
#: muranorepository/openstack/common/service.py:320
#, python-format
msgid "Child %(pid)s exited with status %(code)d"
msgstr ""
#: muranorepository/openstack/common/service.py:324
#, python-format
msgid "pid %d not in child list"
msgstr ""
#: muranorepository/openstack/common/service.py:354
#, python-format
msgid "Caught %s, stopping children"
msgstr ""
#: muranorepository/openstack/common/service.py:372
#, python-format
msgid "Waiting on %d children to exit"
msgstr ""
#: muranorepository/openstack/common/sslutils.py:52
#, python-format
msgid "Unable to find cert_file : %s"
msgstr ""
#: muranorepository/openstack/common/sslutils.py:55
#, python-format
msgid "Unable to find ca_file : %s"
msgstr ""
#: muranorepository/openstack/common/sslutils.py:58
#, python-format
msgid "Unable to find key_file : %s"
msgstr ""
#: muranorepository/openstack/common/sslutils.py:61
msgid ""
"When running server in SSL mode, you must specify both a cert_file and "
"key_file option value in your configuration file"
msgstr ""
#: muranorepository/openstack/common/sslutils.py:100
#, python-format
msgid "Invalid SSL version : %s"
msgstr ""
#: muranorepository/openstack/common/wsgi.py:187
msgid "cannot understand JSON"
msgstr ""
#: muranorepository/openstack/common/wsgi.py:211
msgid "cannot understand XML"
msgstr ""
#: muranorepository/openstack/common/crypto/utils.py:29
msgid "An unknown error occurred in crypto utils."
msgstr ""
#: muranorepository/openstack/common/crypto/utils.py:36
#, python-format
msgid "Block size of %(given)d is too big, max = %(maximum)d"
msgstr ""
#: muranorepository/openstack/common/crypto/utils.py:45
#, python-format
msgid "Length of %(given)d is too long, max = %(maximum)d"
msgstr ""
#: muranorepository/openstack/common/notifier/api.py:129
#, python-format
msgid "%s not in valid priorities"
msgstr ""
#: muranorepository/openstack/common/notifier/api.py:145
#, python-format
msgid ""
"Problem '%(e)s' attempting to send to notification system. "
"Payload=%(payload)s"
msgstr ""
#: muranorepository/openstack/common/notifier/api.py:164
#, python-format
msgid "Failed to load notifier %s. These notifications will not be sent."
msgstr ""
#: muranorepository/openstack/common/notifier/rpc_notifier.py:45
#: muranorepository/openstack/common/notifier/rpc_notifier2.py:51
#, python-format
msgid "Could not send notification to %(topic)s. Payload=%(message)s"
msgstr ""
#: muranorepository/openstack/common/rpc/__init__.py:105
#, python-format
msgid ""
"A RPC is being made while holding a lock. The locks currently held are "
"%(locks)s. This is probably a bug. Please report it. Include the "
"following: [%(stack)s]."
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:75
msgid "Pool creating new connection"
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:202
#, python-format
msgid "No calling threads waiting for msg_id : %(msg_id)s, message : %(data)s"
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:205
#, python-format
msgid "_call_waiters: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:212
#, python-format
msgid ""
"Number of call waiters is greater than warning threshhold: %d. There "
"could be a MulticallProxyWaiter leak."
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:290
#, python-format
msgid "unpacked context: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:341
#, python-format
msgid "UNIQUE_ID is %s."
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:434
#, python-format
msgid "received %s"
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:442
#, python-format
msgid "no method for message: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:443
#, python-format
msgid "No method for message: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:471
#: muranorepository/openstack/common/rpc/impl_zmq.py:280
#, python-format
msgid "Expected exception during message handling (%s)"
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:479
#: muranorepository/openstack/common/rpc/impl_zmq.py:286
msgid "Exception during message handling"
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:553
#, python-format
msgid "Making synchronous call on %s ..."
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:556
#, python-format
msgid "MSG_ID is %s"
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:582
#, python-format
msgid "Making asynchronous cast on %s..."
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:591
msgid "Making asynchronous fanout cast..."
msgstr ""
#: muranorepository/openstack/common/rpc/amqp.py:619
#, python-format
msgid "Sending %(event_type)s on %(topic)s"
msgstr ""
#: muranorepository/openstack/common/rpc/common.py:77
msgid "An unknown RPC related exception occurred."
msgstr ""
#: muranorepository/openstack/common/rpc/common.py:89
msgid "Exception in string format operation"
msgstr ""
#: muranorepository/openstack/common/rpc/common.py:107
#, python-format
msgid ""
"Remote error: %(exc_type)s %(value)s\n"
"%(traceback)s."
msgstr ""
#: muranorepository/openstack/common/rpc/common.py:124
#, python-format
msgid ""
"Timeout while waiting on RPC response - topic: \"%(topic)s\", RPC method:"
" \"%(method)s\" info: \"%(info)s\""
msgstr ""
#: muranorepository/openstack/common/rpc/common.py:141
#: muranorepository/openstack/common/rpc/common.py:142
#: muranorepository/openstack/common/rpc/common.py:143
msgid "<unknown>"
msgstr ""
#: muranorepository/openstack/common/rpc/common.py:147
#, python-format
msgid "Found duplicate message(%(msg_id)s). Skipping it."
msgstr ""
#: muranorepository/openstack/common/rpc/common.py:151
msgid "Invalid reuse of an RPC connection."
msgstr ""
#: muranorepository/openstack/common/rpc/common.py:155
#, python-format
msgid "Specified RPC version, %(version)s, not supported by this endpoint."
msgstr ""
#: muranorepository/openstack/common/rpc/common.py:160
#, python-format
msgid ""
"Specified RPC envelope version, %(version)s, not supported by this "
"endpoint."
msgstr ""
#: muranorepository/openstack/common/rpc/common.py:165
#, python-format
msgid "Specified RPC version cap, %(version_cap)s, is too low"
msgstr ""
#: muranorepository/openstack/common/rpc/common.py:289
#, python-format
msgid "Returning exception %s to caller"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_kombu.py:157
msgid "Failed to process message ... skipping it."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_kombu.py:161
msgid "Failed to process message ... will requeue."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_kombu.py:496
#, python-format
msgid "Reconnecting to AMQP server on %(hostname)s:%(port)d"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_kombu.py:518
#, python-format
msgid "Connected to AMQP server on %(hostname)s:%(port)d"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_kombu.py:555
#, python-format
msgid ""
"Unable to connect to AMQP server on %(hostname)s:%(port)d after "
"%(max_retries)d tries: %(err_str)s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_kombu.py:569
#, python-format
msgid ""
"AMQP server on %(hostname)s:%(port)d is unreachable: %(err_str)s. Trying "
"again in %(sleep_time)d seconds."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_kombu.py:623
#: muranorepository/openstack/common/rpc/impl_qpid.py:585
#, python-format
msgid "Failed to declare consumer for topic '%(topic)s': %(err_str)s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_kombu.py:641
#: muranorepository/openstack/common/rpc/impl_qpid.py:600
#, python-format
msgid "Timed out waiting for RPC response: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_kombu.py:645
#: muranorepository/openstack/common/rpc/impl_qpid.py:604
#, python-format
msgid "Failed to consume message from queue: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_kombu.py:684
#: muranorepository/openstack/common/rpc/impl_qpid.py:639
#, python-format
msgid "Failed to publish message to topic '%(topic)s': %(err_str)s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_qpid.py:89
#, python-format
msgid "Invalid value for qpid_topology_version: %d"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_qpid.py:191
msgid "Failed to process message... skipping it."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_qpid.py:527
#, python-format
msgid "Unable to connect to AMQP server: %(e)s. Sleeping %(delay)s seconds"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_qpid.py:533
#, python-format
msgid "Connected to AMQP server on %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_qpid.py:546
msgid "Re-established AMQP queues"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_qpid.py:612
msgid "Error processing message. Skipping it."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:96
msgid "JSON serialization failed."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:101
#, python-format
msgid "Deserializing: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:136
#, python-format
msgid "Connecting to %(addr)s with %(type)s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:137
#, python-format
msgid "-> Subscribed to %(subscribe)s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:138
#, python-format
msgid "-> bind: %(bind)s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:146
msgid "Could not open socket."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:158
#, python-format
msgid "Subscribing to %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:200
msgid "You cannot recv on this socket."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:205
msgid "You cannot send on this socket."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:267
#, python-format
msgid "Running func with context: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:305
msgid "Sending reply"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:339
msgid "RPC message did not include method."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:371
msgid "Registering reactor"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:383
msgid "In reactor registered"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:388
msgid "Consuming socket"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:438
#, python-format
msgid "Creating proxy for topic: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:444
msgid "Topic contained dangerous characters."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:476
msgid "Topic socket file creation failed."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:482
#, python-format
msgid "Local per-topic backlog buffer full for topic %(topic)s. Dropping message."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:498
#, python-format
msgid "Required IPC directory does not exist at %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:507
#, python-format
msgid "Permission denied to IPC directory at %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:510
msgid "Could not create ZeroMQ receiver daemon. Socket may already be in use."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:544
#, python-format
msgid "CONSUMER RECEIVED DATA: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:563
msgid "ZMQ Envelope version unsupported or unknown."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:591
msgid "Skipping topic registration. Already registered."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:598
#, python-format
msgid "Consumer is a zmq.%s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:650
msgid "Creating payload"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:663
msgid "Creating queue socket for reply waiter"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:676
msgid "Sending cast"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:679
msgid "Cast sent; Waiting reply"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:682
#, python-format
msgid "Received message: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:683
msgid "Unpacking response"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:692
msgid "Unsupported or unknown ZMQ envelope returned."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:699
msgid "RPC Message Invalid."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:722
#, python-format
msgid "%(msg)s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:725
#, python-format
msgid "Sending message(s) to: %s"
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:729
msgid "No matchmaker results. Not casting."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:732
msgid "No match from matchmaker."
msgstr ""
#: muranorepository/openstack/common/rpc/impl_zmq.py:814
#, python-format
msgid "rpc_zmq_matchmaker = %(orig)s is deprecated; use %(new)s instead"
msgstr ""
#: muranorepository/openstack/common/rpc/matchmaker.py:47
msgid "Match not found by MatchMaker."
msgstr ""
#: muranorepository/openstack/common/rpc/matchmaker.py:81
msgid "Matchmaker does not implement registration or heartbeat."
msgstr ""
#: muranorepository/openstack/common/rpc/matchmaker.py:217
#, python-format
msgid "Matchmaker unregistered: %(key)s, %(host)s"
msgstr ""
#: muranorepository/openstack/common/rpc/matchmaker.py:229
msgid "Register before starting heartbeat."
msgstr ""
#: muranorepository/openstack/common/rpc/matchmaker_ring.py:77
#: muranorepository/openstack/common/rpc/matchmaker_ring.py:95
#, python-format
msgid "No key defining hosts for topic '%s', see ringfile"
msgstr ""
#: muranorepository/openstack/common/rpc/service.py:49
#, python-format
msgid "Creating Consumer connection for Service %s"
msgstr ""
#: muranorepository/utils/archiver.py:75
msgid "File {0} already exists"
msgstr ""
#: muranorepository/utils/archiver.py:79
msgid "Unable to copy file {0}"
msgstr ""
#: muranorepository/utils/archiver.py:96
msgid "Archive {0} has hash-sum {1}"
msgstr ""
#: muranorepository/utils/archiver.py:101
msgid "Archive '{0}' doesn't exist, no hash to calculate"
msgstr ""
#: muranorepository/utils/archiver.py:114
msgid "Unable to delete temp directory"
msgstr ""
#: muranorepository/utils/archiver.py:119
msgid ""
"cache_dir parameter should not be None. It is needed to create hash "
"directory"
msgstr ""
#: muranorepository/utils/archiver.py:128
msgid "Unable to move created archive {0} to hash folder {1}"
msgstr ""
#: muranorepository/utils/archiver.py:172
msgid "Archive package is missing at dir {0}"
msgstr ""
#: muranorepository/utils/archiver.py:179
msgid "Archive package matches hash-sum {0}."
msgstr ""
#: muranorepository/utils/archiver.py:202
msgid ""
"{0} data type specified for archiving is not valid. Supported data types "
"are: {1}"
msgstr ""
#: muranorepository/utils/archiver.py:225
msgid "Manifest for {0} service has no file definitions for {1}"
msgstr ""
#: muranorepository/utils/archiver.py:247
msgid "{0} manifest has no file definitions for {1}"
msgstr ""
#: muranorepository/utils/archiver.py:257
msgid "Deleting archive package from {0}."
msgstr ""
#: muranorepository/utils/archiver.py:278
msgid "There is no manifest file in archive"
msgstr ""
#: muranorepository/utils/archiver.py:281
msgid "There are more then one manifest file in archive"
msgstr ""
#: muranorepository/utils/archiver.py:313
msgid ""
"Uploading archive contents folder {0} that does not correspond to "
"supported data types: {1}. It will be ignored"
msgstr ""
#: muranorepository/utils/archiver.py:316
msgid "Unable to extract archive"
msgstr ""
#: muranorepository/utils/parser.py:63
msgid ""
"Attribute 'full_service_name' inside manifest '{0}' has value '{1}' which"
" doesn't correspond to its filename, skipping this manifest completely."
msgstr ""
#: muranorepository/utils/parser.py:77
msgid "'{0}' section should represent a file listing in manifest {1}"
msgstr ""
#: muranorepository/utils/parser.py:89
msgid "File '{0}' specified in manifest '{1}' doesn't exist at '{2}'"
msgstr ""
#: muranorepository/utils/parser.py:103
msgid ""
"Extension of {0} file is not yaml. Only yaml file supported for service "
"manifest files."
msgstr ""
#: muranorepository/utils/parser.py:111
msgid "Failed to load manifest file '{0}'"
msgstr ""
#: muranorepository/utils/parser.py:127
msgid "There is no manifest file '{0}' for {1} service"
msgstr ""
#: muranorepository/utils/parser.py:130
msgid "'{0}' is not file"
msgstr ""
#: muranorepository/utils/parser.py:137
msgid "Failed to load manifest file: '{0}'."
msgstr ""
#: muranorepository/utils/parser.py:151 muranorepository/utils/parser.py:166
msgid "There is no manifest file for '{0}' service"
msgstr ""

View File

@ -58,7 +58,7 @@ def enable_lazy():
def _(msg):
if USE_LAZY:
return Message(msg, 'savanna')
return Message(msg, 'murano')
else:
if six.PY3:
return _t.gettext(msg)

View File

@ -254,7 +254,7 @@ class Archiver(object):
def remove_existing_hash(self, cache_dir, hash):
path = os.path.join(cache_dir, hash)
log.info('Deleting archive package from {0}.'.format(path))
log.info(_('Deleting archive package from {0}.'.format(path)))
shutil.rmtree(path, ignore_errors=True)
def extract(self, path_to_archive):

View File

@ -62,4 +62,4 @@ domain = muranorepository
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = murano-repository/locale/muranorepository.pot
output_file = muranorepository/locale/muranorepository.pot