From 168b7566a51807dfd42f873c810440472aed7171 Mon Sep 17 00:00:00 2001
From: John Griffith <john.griffith@solidfire.com>
Date: Thu, 11 Apr 2013 18:42:59 -0600
Subject: [PATCH] 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
---
 cinder/volume/driver.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

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)
-- 
2.45.2