diff options
| author | Ed Leafe <ed@leafe.com> | 2011-01-21 16:10:26 -0500 |
|---|---|---|
| committer | Ed Leafe <ed@leafe.com> | 2011-01-21 16:10:26 -0500 |
| commit | 09188c61d5359750f9deadcf912f0fa5fbf005b7 (patch) | |
| tree | 53006dc213fc28f8c74179516f109c93603f429a /nova/api | |
| parent | 75f93d83be59a85b63a267dc22458a133c591f8e (diff) | |
| parent | ec60562b1a6d18e6df4024870468c0501dc692f9 (diff) | |
Resolved trunk merge conflicts
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/direct.py | 12 | ||||
| -rw-r--r-- | nova/api/ec2/cloud.py | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/nova/api/direct.py b/nova/api/direct.py index 81b3ae202..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))} @@ -196,6 +202,8 @@ class ServiceWrapper(wsgi.Controller): # TODO(termie): do some basic normalization on methods method = getattr(self.service_handle, action) + # NOTE(vish): make sure we have no unicode keys for py2.6. + params = dict([(str(k), v) for (k, v) in params.iteritems()]) result = method(context, **params) if type(result) is dict or type(result) is list: return self._serialize(result, req) diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 05976afb9..264b9127c 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' |
