From: John Griffith Date: Fri, 12 Apr 2013 00:42:59 +0000 (-0600) Subject: Remove Flags usage from cinder.volume.driver X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=168b7566a51807dfd42f873c810440472aed7171;p=openstack-build%2Fcinder-build.git Remove Flags usage from cinder.volume.driver cinder.volume.driver was using a mix of FLAGS and the new conf options for multi-backend. The result was failure of multi-backend configrations to set the iscsi_helper option. This updates the driver.py file to use the OSLO.cfg and fixes the check for iscsi_helper check in the initialize_connection call, which was undefined. Fixes bug: 1169928 Change-Id: Ia1678893f32a9d08a695f055f59f7296e17d9d78 --- diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index fba35164b..7615932e1 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -27,11 +27,9 @@ import time from oslo.config import cfg from cinder import exception -from cinder import flags from cinder.image import image_utils from cinder.openstack.common import log as logging from cinder import utils -from cinder.volume.configuration import Configuration LOG = logging.getLogger(__name__) @@ -61,9 +59,9 @@ volume_opts = [ default=None, help='The backend name for a given driver implementation'), ] -FLAGS = flags.FLAGS -FLAGS.register_opts(volume_opts) -FLAGS.import_opt('iscsi_helper', 'cinder.volume.iscsi') +CONF = cfg.CONF +CONF.register_opts(volume_opts) +CONF.import_opt('iscsi_helper', 'cinder.volume.iscsi') class VolumeDriver(object): @@ -333,7 +331,7 @@ class ISCSIDriver(VolumeDriver): """ - if self.configuration.iscsi_helper == 'lioadm': + if CONF.iscsi_helper == 'lioadm': self.tgtadm.initialize_connection(volume, connector) iscsi_properties = self._get_iscsi_properties(volume)