summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-01-21 15:53:44 -0800
committerVishvananda Ishaya <vishvananda@gmail.com>2011-01-21 15:53:44 -0800
commit10e22fac85e0684a12325aa987fb6d5c3450bf93 (patch)
tree33ba927530b0f93d3760eb670e34bc72787b3fa1 /nova/api
parent9bdcc71733105a49636f74a99130112ef96d0bce (diff)
parent7da2bb5bd74ff94f65bc11af88694aa79b35f5d5 (diff)
merged trunk fixed whitespace in rst
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/direct.py10
-rw-r--r--nova/api/ec2/cloud.py4
2 files changed, 10 insertions, 4 deletions
diff --git a/nova/api/direct.py b/nova/api/direct.py
index 509ab3ae0..208b6d086 100644
--- a/nova/api/direct.py
+++ b/nova/api/direct.py
@@ -142,9 +142,15 @@ class Reflection(object):
if argspec[2]:
args_out.insert(0, ('**%s' % argspec[2],))
+ if f.__doc__:
+ short_doc = f.__doc__.split('\n')[0]
+ doc = f.__doc__
+ else:
+ short_doc = doc = _('not available')
+
methods['/%s/%s' % (route, k)] = {
- 'short_doc': f.__doc__.split('\n')[0],
- 'doc': f.__doc__,
+ 'short_doc': short_doc,
+ 'doc': doc,
'name': k,
'args': list(reversed(args_out))}
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index c94540793..f63ec9085 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -59,7 +59,7 @@ def _gen_key(context, user_id, key_name):
# creation before creating key_pair
try:
db.key_pair_get(context, user_id, key_name)
- raise exception.Duplicate("The key_pair %s already exists"
+ raise exception.Duplicate(_("The key_pair %s already exists")
% key_name)
except exception.NotFound:
pass
@@ -133,7 +133,7 @@ class CloudController(object):
return result
def _get_availability_zone_by_host(self, context, host):
- services = db.service_get_all_by_host(context, host)
+ services = db.service_get_all_by_host(context.elevated(), host)
if len(services) > 0:
return services[0]['availability_zone']
return 'unknown zone'