~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to nova/api/openstack/extensions.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 13:12:53 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120524131253-ommql08fg1en06ut
Tags: 2012.2~f1-0ubuntu1
* New upstream release.
* Prepare for quantal:
  - Dropped debian/patches/upstream/0006-Use-project_id-in-ec2.cloud._format_image.patch
  - Dropped debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch
  - Dropped debian/patches/upstream/0004-Fixed-bug-962840-added-a-test-case.patch
  - Dropped debian/patches/upstream/0003-Allow-unprivileged-RADOS-users-to-access-rbd-volumes.patch
  - Dropped debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
  - Dropped debian/patches/upstream/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch 
  - Dropped debian/patches/0001-fix-useexisting-deprecation-warnings.patch
* debian/control: Add python-keystone as a dependency. (LP: #907197)
* debian/patches/kombu_tests_timeout.patch: Refreshed.
* debian/nova.conf, debian/nova-common.postinst: Convert to new ini
  file configuration
* debian/patches/nova-manage_flagfile_location.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from nova import exception
28
28
from nova import flags
29
29
from nova import log as logging
 
30
from nova.openstack.common import importutils
30
31
import nova.policy
31
 
from nova import utils
32
32
 
33
33
 
34
34
LOG = logging.getLogger(__name__)
188
188
        LOG.audit(_('Loaded extension: %s'), alias)
189
189
 
190
190
        if alias in self.extensions:
191
 
            raise exception.Error("Found duplicate extension: %s" % alias)
 
191
            raise exception.NovaException("Found duplicate extension: %s"
 
192
                                          % alias)
192
193
        self.extensions[alias] = ext
193
194
 
194
195
    def get_resources(self):
246
247
        LOG.debug(_("Loading extension %s"), ext_factory)
247
248
 
248
249
        # Load the factory
249
 
        factory = utils.import_class(ext_factory)
 
250
        factory = importutils.import_class(ext_factory)
250
251
 
251
252
        # Call it
252
253
        LOG.debug(_("Calling extension factory %s"), ext_factory)
356
357
            ext_name = ("%s%s.%s.extension" %
357
358
                        (package, relpkg, dname))
358
359
            try:
359
 
                ext = utils.import_class(ext_name)
360
 
            except exception.ClassNotFound:
 
360
                ext = importutils.import_class(ext_name)
 
361
            except ImportError:
361
362
                # extension() doesn't exist on it, so we'll explore
362
363
                # the directory for ourselves
363
364
                subdirs.append(dname)