From: John Griffith Date: Wed, 10 Apr 2013 05:07:52 +0000 (-0600) Subject: Add parsing to extra-specs key check X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=319f71276ad2bcf8a222b81484e67d3a20f295dc;p=openstack-build%2Fcinder-build.git Add parsing to extra-specs key check When using the filter scheduler which is now the default, we can no longer pass in extra-specs like: {minIOPS:500, ....}, because the capabilities filter will reject this because there is no host reporting minIOPS:500 capabilities. We now need to scope the keys (ie qos:minIOPS:500....), but that unfortunately requires a fix to the SolidFire driver. This change add a check for the ':' in the key, and parses on it if it's there. Also fixes backend_name and uses VERSION var instead of generating string in stats reporting. Fixes bug: 1167141 Change-Id: Ie7fd7d231af78cb18a13f44a4379b44d3c3385df (cherry picked from commit 0e3ea4e85dab00b7cecd5596f6daa65cc4d710b5) --- diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py index 8d0c55280..840cecce7 100644 --- a/cinder/volume/drivers/solidfire.py +++ b/cinder/volume/drivers/solidfire.py @@ -33,7 +33,7 @@ from cinder.openstack.common import log as logging from cinder.volume.drivers.san.san import SanISCSIDriver from cinder.volume import volume_types -VERSION = 1.2 +VERSION = '1.2' LOG = logging.getLogger(__name__) sf_opts = [ @@ -369,6 +369,9 @@ class SolidFire(SanISCSIDriver): volume_type = volume_types.get_volume_type(ctxt, type_id) specs = volume_type.get('extra_specs') for key, value in specs.iteritems(): + if ':' in key: + fields = key.split(':') + key = fields[1] if key in self.sf_qos_keys: qos[key] = int(value) return qos @@ -560,9 +563,10 @@ class SolidFire(SanISCSIDriver): results['maxProvisionedSpace'] - results['usedSpace'] data = {} - data["volume_backend_name"] = self.__class__.__name__ + backend_name = self.configuration.safe_get('volume_backend_name') + data["volume_backend_name"] = backend_name or self.__class__.__name__ data["vendor_name"] = 'SolidFire Inc' - data["driver_version"] = '1.2' + data["driver_version"] = VERSION data["storage_protocol"] = 'iSCSI' data['total_capacity_gb'] = results['maxProvisionedSpace']