~xtoddx/nova/disable_creds

« back to all changes in this revision

Viewing changes to nova/compute/manager.py

  • Committer: Tarmac
  • Author(s): Josh Kearney
  • Date: 2011-03-21 18:46:59 UTC
  • mfrom: (815.7.3 lp660042)
  • Revision ID: tarmac-20110321184659-xelepaqewfcy5kzw
Provide more useful exception messages when unable to load the virtual driver.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
import random
40
40
import string
41
41
import socket
 
42
import sys
42
43
import tempfile
43
44
import time
44
45
import functools
114
115
        #             and redocument the module docstring
115
116
        if not compute_driver:
116
117
            compute_driver = FLAGS.compute_driver
117
 
        self.driver = utils.import_object(compute_driver)
 
118
 
 
119
        try:
 
120
            self.driver = utils.import_object(compute_driver)
 
121
        except ImportError:
 
122
            LOG.error("Unable to load the virtualization driver.")
 
123
            sys.exit(1)
 
124
 
118
125
        self.network_manager = utils.import_object(FLAGS.network_manager)
119
126
        self.volume_manager = utils.import_object(FLAGS.volume_manager)
120
127
        super(ComputeManager, self).__init__(*args, **kwargs)
221
228
                                    instance_id,
222
229
                                    {'launched_at': now})
223
230
        except Exception:  # pylint: disable=W0702
224
 
            LOG.exception(_("instance %s: Failed to spawn"), instance_id,
225
 
                          context=context)
 
231
            LOG.exception(_("Instance '%s' failed to spawn. Is virtualization"
 
232
                            " enabled in the BIOS?"), instance_id,
 
233
                                                     context=context)
226
234
            self.db.instance_set_state(context,
227
235
                                       instance_id,
228
236
                                       power_state.SHUTDOWN)