~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/scheduler/filters/ram_filter.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-08-16 14:04:11 UTC
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: package-import@ubuntu.com-20120816140411-0mr4n241wmk30t9l
Tags: upstream-2012.2~f3
ImportĀ upstreamĀ versionĀ 2012.2~f3

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        free_ram_mb = host_state.free_ram_mb
40
40
        total_usable_ram_mb = host_state.total_usable_ram_mb
41
41
        used_ram_mb = total_usable_ram_mb - free_ram_mb
42
 
        return (total_usable_ram_mb * FLAGS.ram_allocation_ratio -
43
 
                used_ram_mb >= requested_ram)
 
42
        usable_ram = (total_usable_ram_mb * FLAGS.ram_allocation_ratio -
 
43
                used_ram_mb)
 
44
        if not usable_ram >= requested_ram:
 
45
            LOG.debug(_("%(host_state)s does not have %(requested_ram)s MB "
 
46
                    "usable ram, it only has %(usable_ram)s MB usable ram."),
 
47
                    locals())
 
48
            return False
 
49
        return True