i18n raise Exception messages
Provide i18n to some exceptions that were not provided before. Change-Id: Ia320ba5f12e82686c8ee7973a77f152eb4b02bd4 Signed-off-by: Chuck Short <chuck.short@canonical.com>
This commit is contained in:
@@ -523,15 +523,16 @@ class NetworkCommands(object):
|
|||||||
"""Deletes a network"""
|
"""Deletes a network"""
|
||||||
|
|
||||||
if fixed_range is None and uuid is None:
|
if fixed_range is None and uuid is None:
|
||||||
raise Exception("Please specify either fixed_range or uuid")
|
raise Exception(_("Please specify either fixed_range or uuid"))
|
||||||
|
|
||||||
net_manager = importutils.import_object(CONF.network_manager)
|
net_manager = importutils.import_object(CONF.network_manager)
|
||||||
if "QuantumManager" in CONF.network_manager:
|
if "QuantumManager" in CONF.network_manager:
|
||||||
if uuid is None:
|
if uuid is None:
|
||||||
raise Exception("UUID is required to delete Quantum Networks")
|
raise Exception(_("UUID is required to delete "
|
||||||
|
"Quantum Networks"))
|
||||||
if fixed_range:
|
if fixed_range:
|
||||||
raise Exception("Deleting by fixed_range is not supported "
|
raise Exception(_("Deleting by fixed_range is not supported "
|
||||||
"with the QuantumManager")
|
"with the QuantumManager"))
|
||||||
# delete the network
|
# delete the network
|
||||||
net_manager.delete_network(context.get_admin_context(),
|
net_manager.delete_network(context.get_admin_context(),
|
||||||
fixed_range, uuid)
|
fixed_range, uuid)
|
||||||
|
@@ -91,7 +91,7 @@ class NovaWebSocketProxy(websockify.WebSocketProxy):
|
|||||||
|
|
||||||
if not connect_info:
|
if not connect_info:
|
||||||
LOG.audit("Invalid Token: %s", token)
|
LOG.audit("Invalid Token: %s", token)
|
||||||
raise Exception("Invalid Token")
|
raise Exception(_("Invalid Token"))
|
||||||
|
|
||||||
host = connect_info['host']
|
host = connect_info['host']
|
||||||
port = int(connect_info['port'])
|
port = int(connect_info['port'])
|
||||||
@@ -110,7 +110,7 @@ class NovaWebSocketProxy(websockify.WebSocketProxy):
|
|||||||
if data.find("\r\n\r\n") != -1:
|
if data.find("\r\n\r\n") != -1:
|
||||||
if not data.split("\r\n")[0].find("200"):
|
if not data.split("\r\n")[0].find("200"):
|
||||||
LOG.audit("Invalid Connection Info %s", token)
|
LOG.audit("Invalid Connection Info %s", token)
|
||||||
raise Exception("Invalid Connection Info")
|
raise Exception(_("Invalid Connection Info"))
|
||||||
tsock.recv(len(data))
|
tsock.recv(len(data))
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user