diff options
| author | Josh Kearney <josh.kearney@rackspace.com> | 2011-03-21 18:46:59 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-03-21 18:46:59 +0000 |
| commit | 246b146a46474266d7568b5df5cef8864cdaaa6b (patch) | |
| tree | 1c219808a8c113bf09b090c32f2aef3c6a5ff7ec /nova | |
| parent | fb8b0636d02e3663485d4c386a362c7d5ef35041 (diff) | |
| parent | b3bb847e3dc20611c4a975d3c772256700b2d018 (diff) | |
Provide more useful exception messages when unable to load the virtual driver.
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/compute/manager.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index c2781f6fb..576937cd8 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -39,6 +39,7 @@ import os import random import string import socket +import sys import tempfile import time import functools @@ -114,7 +115,13 @@ class ComputeManager(manager.Manager): # and redocument the module docstring if not compute_driver: compute_driver = FLAGS.compute_driver - self.driver = utils.import_object(compute_driver) + + try: + self.driver = utils.import_object(compute_driver) + except ImportError: + LOG.error("Unable to load the virtualization driver.") + sys.exit(1) + self.network_manager = utils.import_object(FLAGS.network_manager) self.volume_manager = utils.import_object(FLAGS.volume_manager) super(ComputeManager, self).__init__(*args, **kwargs) @@ -221,8 +228,9 @@ class ComputeManager(manager.Manager): instance_id, {'launched_at': now}) except Exception: # pylint: disable=W0702 - LOG.exception(_("instance %s: Failed to spawn"), instance_id, - context=context) + LOG.exception(_("Instance '%s' failed to spawn. Is virtualization" + " enabled in the BIOS?"), instance_id, + context=context) self.db.instance_set_state(context, instance_id, power_state.SHUTDOWN) |
