summaryrefslogtreecommitdiffstats
path: root/nova/db
diff options
context:
space:
mode:
authorJosh Kearney <josh.kearney@rackspace.com>2010-12-22 10:43:40 -0600
committerJosh Kearney <josh.kearney@rackspace.com>2010-12-22 10:43:40 -0600
commit876e01a7efb669e76b011e04178b662677de3fc2 (patch)
treef7bdeabd7034640c4ecb1acc95a307ad5b31de26 /nova/db
parentd85c78d62fe3f84276b1ed37dc56907c88fc1df7 (diff)
parentd9b37f9a3b6cc7dbf6026ceb94b9e4c585e59e01 (diff)
Merged trunk
Diffstat (limited to 'nova/db')
-rw-r--r--nova/db/sqlalchemy/api.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index f409560cf..a36f767a7 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -41,7 +41,7 @@ FLAGS = flags.FLAGS
def is_admin_context(context):
"""Indicates if the request context is an administrator."""
if not context:
- warnings.warn('Use of empty request context is deprecated',
+ warnings.warn(_('Use of empty request context is deprecated'),
DeprecationWarning)
raise Exception('die')
return context.is_admin
@@ -130,7 +130,7 @@ def service_get(context, service_id, session=None):
first()
if not result:
- raise exception.NotFound('No service for id %s' % service_id)
+ raise exception.NotFound(_('No service for id %s') % service_id)
return result
@@ -227,7 +227,7 @@ def service_get_by_args(context, host, binary):
filter_by(deleted=can_read_deleted(context)).\
first()
if not result:
- raise exception.NotFound('No service for %s, %s' % (host, binary))
+ raise exception.NotFound(_('No service for %s, %s') % (host, binary))
return result
@@ -491,7 +491,7 @@ def fixed_ip_get_by_address(context, address, session=None):
options(joinedload('instance')).\
first()
if not result:
- raise exception.NotFound('No floating ip for address %s' % address)
+ raise exception.NotFound(_('No floating ip for address %s') % address)
if is_user_context(context):
authorize_project_context(context, result.instance.project_id)
@@ -593,7 +593,7 @@ def instance_get(context, instance_id, session=None):
filter_by(deleted=False).\
first()
if not result:
- raise exception.NotFound('No instance for id %s' % instance_id)
+ raise exception.NotFound(_('No instance for id %s') % instance_id)
return result
@@ -671,7 +671,7 @@ def instance_get_by_internal_id(context, internal_id):
filter_by(deleted=False).\
first()
if not result:
- raise exception.NotFound('Instance %s not found' % (internal_id))
+ raise exception.NotFound(_('Instance %s not found') % (internal_id))
return result
@@ -804,7 +804,7 @@ def key_pair_get(context, user_id, name, session=None):
filter_by(deleted=can_read_deleted(context)).\
first()
if not result:
- raise exception.NotFound('no keypair for user %s, name %s' %
+ raise exception.NotFound(_('no keypair for user %s, name %s') %
(user_id, name))
return result
@@ -919,7 +919,7 @@ def network_get(context, network_id, session=None):
filter_by(deleted=False).\
first()
if not result:
- raise exception.NotFound('No network for id %s' % network_id)
+ raise exception.NotFound(_('No network for id %s') % network_id)
return result
@@ -949,7 +949,7 @@ def network_get_by_bridge(context, bridge):
first()
if not result:
- raise exception.NotFound('No network for bridge %s' % bridge)
+ raise exception.NotFound(_('No network for bridge %s') % bridge)
return result
@@ -963,7 +963,7 @@ def network_get_by_instance(_context, instance_id):
filter_by(deleted=False).\
first()
if not rv:
- raise exception.NotFound('No network for instance %s' % instance_id)
+ raise exception.NotFound(_('No network for instance %s') % instance_id)
return rv
@@ -977,7 +977,7 @@ def network_set_host(context, network_id, host_id):
with_lockmode('update').\
first()
if not network_ref:
- raise exception.NotFound('No network for id %s' % network_id)
+ raise exception.NotFound(_('No network for id %s') % network_id)
# NOTE(vish): if with_lockmode isn't supported, as in sqlite,
# then this has concurrency issues
@@ -1089,7 +1089,7 @@ def auth_get_token(_context, token_hash):
filter_by(token_hash=token_hash).\
first()
if not tk:
- raise exception.NotFound('Token %s does not exist' % token_hash)
+ raise exception.NotFound(_('Token %s does not exist') % token_hash)
return tk
@@ -1113,7 +1113,7 @@ def quota_get(context, project_id, session=None):
filter_by(deleted=can_read_deleted(context)).\
first()
if not result:
- raise exception.NotFound('No quota for project_id %s' % project_id)
+ raise exception.NotFound(_('No quota for project_id %s') % project_id)
return result
@@ -1268,7 +1268,7 @@ def volume_get(context, volume_id, session=None):
filter_by(deleted=False).\
first()
if not result:
- raise exception.NotFound('No volume for id %s' % volume_id)
+ raise exception.NotFound(_('No volume for id %s') % volume_id)
return result
@@ -1324,7 +1324,7 @@ def volume_get_by_ec2_id(context, ec2_id):
raise exception.NotAuthorized()
if not result:
- raise exception.NotFound('Volume %s not found' % ec2_id)
+ raise exception.NotFound(_('Volume %s not found') % ec2_id)
return result
@@ -1348,7 +1348,7 @@ def volume_get_instance(context, volume_id):
options(joinedload('instance')).\
first()
if not result:
- raise exception.NotFound('Volume %s not found' % ec2_id)
+ raise exception.NotFound(_('Volume %s not found') % ec2_id)
return result.instance
@@ -1360,7 +1360,7 @@ def volume_get_shelf_and_blade(context, volume_id):
filter_by(volume_id=volume_id).\
first()
if not result:
- raise exception.NotFound('No export device found for volume %s' %
+ raise exception.NotFound(_('No export device found for volume %s') %
volume_id)
return (result.shelf_id, result.blade_id)
@@ -1373,7 +1373,7 @@ def volume_get_iscsi_target_num(context, volume_id):
filter_by(volume_id=volume_id).\
first()
if not result:
- raise exception.NotFound('No target id found for volume %s' %
+ raise exception.NotFound(_('No target id found for volume %s') %
volume_id)
return result.target_num
@@ -1418,7 +1418,7 @@ def security_group_get(context, security_group_id, session=None):
options(joinedload_all('rules')).\
first()
if not result:
- raise exception.NotFound("No secuity group with id %s" %
+ raise exception.NotFound(_("No security group with id %s") %
security_group_id)
return result
@@ -1435,7 +1435,7 @@ def security_group_get_by_name(context, project_id, group_name):
first()
if not result:
raise exception.NotFound(
- 'No security group named %s for project: %s' \
+ _('No security group named %s for project: %s')
% (group_name, project_id))
return result
@@ -1523,7 +1523,7 @@ def security_group_rule_get(context, security_group_rule_id, session=None):
filter_by(id=security_group_rule_id).\
first()
if not result:
- raise exception.NotFound("No secuity group rule with id %s" %
+ raise exception.NotFound(_("No secuity group rule with id %s") %
security_group_rule_id)
return result
@@ -1559,7 +1559,7 @@ def user_get(context, id, session=None):
first()
if not result:
- raise exception.NotFound('No user for id %s' % id)
+ raise exception.NotFound(_('No user for id %s') % id)
return result
@@ -1575,7 +1575,7 @@ def user_get_by_access_key(context, access_key, session=None):
first()
if not result:
- raise exception.NotFound('No user for access key %s' % access_key)
+ raise exception.NotFound(_('No user for access key %s') % access_key)
return result
@@ -1637,7 +1637,7 @@ def project_get(context, id, session=None):
first()
if not result:
- raise exception.NotFound("No project with id %s" % id)
+ raise exception.NotFound(_("No project with id %s") % id)
return result