diff options
| author | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-06-16 21:27:17 +0000 |
|---|---|---|
| committer | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-06-16 21:27:17 +0000 |
| commit | da09c8fca687d0756cda38c5bd038d677dacd1f3 (patch) | |
| tree | 156fa6a6ef4ee140a5bc770fde11e7660468aba7 | |
| parent | 1763419a3f6b01bb0ef98c700f0f350e756b359c (diff) | |
| download | nova-da09c8fca687d0756cda38c5bd038d677dacd1f3.tar.gz nova-da09c8fca687d0756cda38c5bd038d677dacd1f3.tar.xz nova-da09c8fca687d0756cda38c5bd038d677dacd1f3.zip | |
Fix lp795123 and lp795126 by making _check_extension() return True or False and checking the result only from the top of _add_extension()
| -rw-r--r-- | nova/api/openstack/extensions.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nova/api/openstack/extensions.py b/nova/api/openstack/extensions.py index 54e17e23d..28d9d9192 100644 --- a/nova/api/openstack/extensions.py +++ b/nova/api/openstack/extensions.py @@ -374,6 +374,8 @@ class ExtensionManager(object): LOG.debug(_('Ext updated: %s'), extension.get_updated()) except AttributeError as ex: LOG.exception(_("Exception loading extension: %s"), unicode(ex)) + return False + return True def _load_all_extensions(self): """Load extensions from the configured path. @@ -412,15 +414,16 @@ class ExtensionManager(object): 'file': ext_path}) continue new_ext = new_ext_class() - self._check_extension(new_ext) self._add_extension(new_ext) def _add_extension(self, ext): + # Do nothing if the extension doesn't check out + if not self._check_extension(ext): + return + alias = ext.get_alias() LOG.audit(_('Loaded extension: %s'), alias) - self._check_extension(ext) - if alias in self.extensions: raise exception.Error("Found duplicate extension: %s" % alias) self.extensions[alias] = ext |
