~usrleon/nova/nova-api-creds

« back to all changes in this revision

Viewing changes to nova/scheduler/driver.py

  • Committer: Tarmac
  • Author(s): Brian Waldon
  • Date: 2011-04-30 02:31:29 UTC
  • mfrom: (1032.1.2 exception-cleanup)
  • Revision ID: tarmac-20110430023129-8k9bbgvj3ec8p965
Final cleanup of nova/exceptions.py in my series of refactoring branches

Show diffs side-by-side

added added

removed removed

Lines of Context:
255
255
        mem_avail = mem_total - mem_used
256
256
        mem_inst = instance_ref['memory_mb']
257
257
        if mem_avail <= mem_inst:
258
 
            raise exception.NotEmpty(_("Unable to migrate %(ec2_id)s "
259
 
                                       "to destination: %(dest)s "
260
 
                                       "(host:%(mem_avail)s "
261
 
                                       "<= instance:%(mem_inst)s)")
262
 
                                       % locals())
 
258
            reason = _("Unable to migrate %(ec2_id)s to destination: %(dest)s "
 
259
                       "(host:%(mem_avail)s <= instance:%(mem_inst)s)")
 
260
            raise exception.MigrationError(reason=reason % locals())
263
261
 
264
262
    def mounted_on_same_shared_storage(self, context, instance_ref, dest):
265
263
        """Check if the src and dest host mount same shared storage.