~ubuntu-branches/ubuntu/trusty/cinder/trusty

« back to all changes in this revision

Viewing changes to cinder/scheduler/filters/capacity_filter.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Yolanda Robla Mota, James Page, Chuck Short
  • Date: 2013-02-22 10:45:17 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20130222104517-ng3r6ace9vi4m869
Tags: 2013.1.g3-0ubuntu1
[ Yolanda Robla Mota ]
* d/control: Add BD on python-hp3parclient.
* d/patches: Drop patches related to disabling hp3parclient.

[ James Page ]
* d/control: Add Suggests: python-hp3parclient for python-cinder.
* d/control: Add BD on python-oslo-config.
* d/*: Wrapped and sorted.

[ Chuck Short ]
* New upstream release.
* debian/rules, debian/cinder-volumes.install: 
  - Fail if binaries are missing and install missing binaries.
* debian/patches/fix-ubuntu-tests.patch: Fix failing tests.
* debian/control: Add python-rtslib and python-mock.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
                          "volume node info collection broken."))
39
39
            return False
40
40
 
 
41
        free_space = host_state.free_capacity_gb
 
42
        if free_space == 'infinite' or free_space == 'unknown':
 
43
            # NOTE(zhiteng) for those back-ends cannot report actual
 
44
            # available capacity, we assume it is able to serve the
 
45
            # request.  Even if it was not, the retry mechanism is
 
46
            # able to handle the failure by rescheduling
 
47
            return True
41
48
        reserved = float(host_state.reserved_percentage) / 100
42
 
        free = math.floor(host_state.free_capacity_gb * (1 - reserved))
 
49
        free = math.floor(free_space * (1 - reserved))
43
50
 
44
51
        return free >= volume_size