OpenStack Block Storage (Cinder)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.9 KiB

# 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
# 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.
"""Event ID and user visible message mapping.
Event IDs are used to look up the message to be displayed for an API Message
object. All defined messages should be appropriate for any API user to see
and not contain any sensitive information. A good rule-of-thumb is to be very
general in error messages unless the issue is due to a bad user action, then be
from cinder.i18n import _
class EventIds(object):
event_id_message_map = {
EventIds.UNKNOWN_ERROR: _("An unknown error occurred."),
"No storage could be allocated for this volume "
"request. You may be able to try another size or"
" volume type."),
"A readonly volume must be attached as readonly."),
"Failed to copy volume to image as image quota has been met. Please "
"delete images or have your limit increased, then try again."),
"Unmanaging encrypted volumes is not supported."),
def get_message_text(event_id):
return event_id_message_map[event_id]