Skip to content

Commit

Permalink
Remove Flags usage from cinder.volume.driver
Browse files Browse the repository at this point in the history
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
(cherry picked from commit 168b756)
  • Loading branch information
j-griffith committed Apr 20, 2013
1 parent 875e42f commit 6008be0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cinder/volume/driver.py
Expand Up @@ -27,11 +27,9 @@
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__)

Expand Down Expand Up @@ -61,9 +59,9 @@
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):
Expand Down Expand Up @@ -333,7 +331,7 @@ def initialize_connection(self, volume, connector):
"""

if self.configuration.iscsi_helper == 'lioadm':
if CONF.iscsi_helper == 'lioadm':
self.tgtadm.initialize_connection(volume, connector)

iscsi_properties = self._get_iscsi_properties(volume)
Expand Down

0 comments on commit 6008be0

Please sign in to comment.