]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Update/Publish volume service updates on delete.
authorJohn Griffith <john.griffith@solidfire.com>
Fri, 17 May 2013 20:03:38 +0000 (14:03 -0600)
committerJohn Griffith <john.griffith@solidfire.com>
Fri, 17 May 2013 20:35:48 +0000 (14:35 -0600)
The Filter scheduler weighing function was failing because
we were only updating the capacity info either on the periodic
60 second interval or after succesful creates.

The result was that if you exceeded your capacity within the
update interval you would no longer be able to create volumes even
if you deleted existing volumes until the update was performed and
published.

Since we're updating on on create, there's no reason why we shouldn't
do the same on delete for the applicable volume-service.

The periodic updates are still important for other purposes so they're left
alone, but with this change we keep things up to date so the filter scheduler
has the correct picture of the world.

Fixes bug: 1180976

Change-Id: Ic551f512c5a0cf51bafa8b60f0b6b7debbe22692

cinder/volume/manager.py

index fecbffe22bf5e59860ebe8a144c5388c535b2d76..82871a538d52a8b442d3469e369d5ca3c559631c 100644 (file)
@@ -45,7 +45,6 @@ from oslo.config import cfg
 
 from cinder import context
 from cinder import exception
-from cinder import flags
 from cinder.image import glance
 from cinder import manager
 from cinder.openstack.common import excutils
@@ -57,7 +56,6 @@ from cinder import quota
 from cinder import utils
 from cinder.volume.configuration import Configuration
 from cinder.volume import utils as volume_utils
-from cinder.volume import volume_types
 
 LOG = logging.getLogger(__name__)
 
@@ -451,6 +449,8 @@ class VolumeManager(manager.SchedulerDependentManager):
         if reservations:
             QUOTAS.commit(context, reservations, project_id=project_id)
 
+        self.publish_service_capabilities(context)
+
         return True
 
     def create_snapshot(self, context, volume_id, snapshot_id):