summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorArmando Migliaccio <armando.migliaccio@citrix.com>2011-03-28 22:04:52 +0100
committerArmando Migliaccio <armando.migliaccio@citrix.com>2011-03-28 22:04:52 +0100
commit30ad1f72b2e71fa81b71f88b2abd9a23a1d2ed10 (patch)
tree853545b6aa0e76a2c7139cf927f3703b21ecc298 /nova/api
parentc1ed5fc3dfeecef281df45cd2e6779fa21c63bf5 (diff)
parent848c8212a4c9c53f0e2a6b4154fb9504b95db060 (diff)
merge trunk
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/cloud.py2
-rw-r--r--nova/api/openstack/__init__.py10
-rw-r--r--nova/api/openstack/backup_schedules.py6
-rw-r--r--nova/api/openstack/extensions.py19
4 files changed, 23 insertions, 14 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 0da642318..9e34d3317 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -890,6 +890,8 @@ class CloudController(object):
i['imageOwnerId'] = image['properties'].get('owner_id')
i['imageLocation'] = image['properties'].get('image_location')
i['imageState'] = image['properties'].get('image_state')
+ i['displayName'] = image.get('name')
+ i['description'] = image.get('description')
i['type'] = image_type
i['isPublic'] = str(image['properties'].get('is_public', '')) == 'True'
i['architecture'] = image['properties'].get('architecture')
diff --git a/nova/api/openstack/__init__.py b/nova/api/openstack/__init__.py
index 8fabbce8e..149abfeb8 100644
--- a/nova/api/openstack/__init__.py
+++ b/nova/api/openstack/__init__.py
@@ -106,11 +106,6 @@ class APIRouter(wsgi.Router):
controller=accounts.Controller(),
collection={'detail': 'GET'})
- mapper.resource("backup_schedule", "backup_schedule",
- controller=backup_schedules.Controller(),
- parent_resource=dict(member_name='server',
- collection_name='servers'))
-
mapper.resource("console", "consoles",
controller=consoles.Controller(),
parent_resource=dict(member_name='server',
@@ -141,6 +136,11 @@ class APIRouterV10(APIRouter):
controller=flavors.ControllerV10(),
collection={'detail': 'GET'})
+ mapper.resource("backup_schedule", "backup_schedule",
+ controller=backup_schedules.Controller(),
+ parent_resource=dict(member_name='server',
+ collection_name='servers'))
+
class APIRouterV11(APIRouter):
"""Define routes specific to OpenStack API V1.1."""
diff --git a/nova/api/openstack/backup_schedules.py b/nova/api/openstack/backup_schedules.py
index 7abb5f884..f2d2d86e8 100644
--- a/nova/api/openstack/backup_schedules.py
+++ b/nova/api/openstack/backup_schedules.py
@@ -42,7 +42,11 @@ class Controller(wsgi.Controller):
def index(self, req, server_id):
""" Returns the list of backup schedules for a given instance """
- return _translate_keys({})
+ return faults.Fault(exc.HTTPNotImplemented())
+
+ def show(self, req, server_id, id):
+ """ Returns a single backup schedule for a given instance """
+ return faults.Fault(exc.HTTPNotImplemented())
def create(self, req, server_id):
""" No actual update method required, since the existing API allows
diff --git a/nova/api/openstack/extensions.py b/nova/api/openstack/extensions.py
index 9d98d849a..b9b7f998d 100644
--- a/nova/api/openstack/extensions.py
+++ b/nova/api/openstack/extensions.py
@@ -317,16 +317,19 @@ class ExtensionManager(object):
LOG.audit(_('Loading extension file: %s'), f)
mod_name, file_ext = os.path.splitext(os.path.split(f)[-1])
ext_path = os.path.join(self.path, f)
- if file_ext.lower() == '.py':
+ if file_ext.lower() == '.py' and not mod_name.startswith('_'):
mod = imp.load_source(mod_name, ext_path)
ext_name = mod_name[0].upper() + mod_name[1:]
- try:
- new_ext = getattr(mod, ext_name)()
- self._check_extension(new_ext)
- self.extensions[new_ext.get_alias()] = new_ext
- except AttributeError as ex:
- LOG.exception(_("Exception loading extension: %s"),
- unicode(ex))
+ new_ext_class = getattr(mod, ext_name, None)
+ if not new_ext_class:
+ LOG.warn(_('Did not find expected name '
+ '"%(ext_name)" in %(file)s'),
+ {'ext_name': ext_name,
+ 'file': ext_path})
+ continue
+ new_ext = new_ext_class()
+ self._check_extension(new_ext)
+ self.extensions[new_ext.get_alias()] = new_ext
class ResponseExtension(object):