Update libvirt volume drivers to use os-brick constants
Most drivers had hard coded protocol strings, and one driver was using a constant from os-brick that has been deprecated for removal for quite some time. This updates all volume drivers to use the current available constants from os-brick. Change-Id: I8682804d2299db793c1e4397a07ff67608a8bda6 Closes-bug: #1721993
This commit is contained in:
parent
a347b8099e
commit
3daeb9681e
|
@ -10,6 +10,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from os_brick import initiator
|
||||
from os_brick.initiator import connector
|
||||
from oslo_log import log as logging
|
||||
|
||||
|
@ -31,7 +32,7 @@ class LibvirtAOEVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):
|
|||
# Call the factory here so we can support
|
||||
# more than x86 architectures.
|
||||
self.connector = connector.InitiatorConnector.factory(
|
||||
'AOE', utils.get_root_helper(),
|
||||
initiator.AOE, utils.get_root_helper(),
|
||||
device_scan_attempts=CONF.libvirt.num_aoe_discover_tries)
|
||||
|
||||
def get_config(self, connection_info, disk_info):
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
"""Libvirt volume driver for DISCO."""
|
||||
|
||||
from os_brick import initiator
|
||||
from os_brick.initiator import connector
|
||||
|
||||
import nova.conf
|
||||
|
@ -36,7 +37,7 @@ class LibvirtDISCOVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):
|
|||
super(LibvirtDISCOVolumeDriver, self).__init__(host,
|
||||
is_block_dev=False)
|
||||
self.connector = connector.InitiatorConnector.factory(
|
||||
'DISCO', utils.get_root_helper(),
|
||||
initiator.DISCO, utils.get_root_helper(),
|
||||
device_scan_attempts=CONF.libvirt.num_volume_scan_tries)
|
||||
|
||||
def get_config(self, connection_info, disk_info):
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from os_brick import initiator
|
||||
from os_brick.initiator import connector
|
||||
from oslo_log import log as logging
|
||||
|
||||
|
@ -26,7 +27,7 @@ class LibvirtDRBDVolumeDriver(libvirt_volume.LibvirtVolumeDriver):
|
|||
def __init__(self, host):
|
||||
super(LibvirtDRBDVolumeDriver, self).__init__(host)
|
||||
self.connector = connector.InitiatorConnector.factory(
|
||||
connector.DRBD, utils.get_root_helper())
|
||||
initiator.DRBD, utils.get_root_helper())
|
||||
|
||||
def connect_volume(self, connection_info, disk_info, instance):
|
||||
"""Connect the volume.
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from os_brick import initiator
|
||||
from os_brick.initiator import connector
|
||||
from oslo_log import log as logging
|
||||
|
||||
|
@ -32,7 +33,7 @@ class LibvirtFibreChannelVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):
|
|||
# Call the factory here so we can support
|
||||
# more than x86 architectures.
|
||||
self.connector = connector.InitiatorConnector.factory(
|
||||
'FIBRE_CHANNEL', utils.get_root_helper(),
|
||||
initiator.FIBRE_CHANNEL, utils.get_root_helper(),
|
||||
use_multipath=CONF.libvirt.volume_use_multipath,
|
||||
device_scan_attempts=CONF.libvirt.num_volume_scan_tries)
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from os_brick import initiator
|
||||
from os_brick.initiator import connector
|
||||
|
||||
import nova.conf
|
||||
|
@ -29,7 +30,7 @@ class LibvirtHGSTVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):
|
|||
super(LibvirtHGSTVolumeDriver,
|
||||
self).__init__(host, is_block_dev=True)
|
||||
self.connector = connector.InitiatorConnector.factory(
|
||||
'HGST', utils.get_root_helper(),
|
||||
initiator.HGST, utils.get_root_helper(),
|
||||
device_scan_attempts=CONF.libvirt.num_volume_scan_tries)
|
||||
|
||||
def get_config(self, connection_info, disk_info):
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"""Libvirt volume driver for iSCSI"""
|
||||
|
||||
from os_brick import exception as os_brick_exception
|
||||
from os_brick import initiator
|
||||
from os_brick.initiator import connector
|
||||
from oslo_log import log as logging
|
||||
|
||||
|
@ -34,7 +35,7 @@ class LibvirtISCSIVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):
|
|||
# Call the factory here so we can support
|
||||
# more than x86 architectures.
|
||||
self.connector = connector.InitiatorConnector.factory(
|
||||
'ISCSI', utils.get_root_helper(),
|
||||
initiator.ISCSI, utils.get_root_helper(),
|
||||
use_multipath=CONF.libvirt.volume_use_multipath,
|
||||
device_scan_attempts=CONF.libvirt.num_volume_scan_tries,
|
||||
transport=self._get_transport())
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from os_brick import initiator
|
||||
from os_brick.initiator import connector
|
||||
|
||||
import nova.conf
|
||||
|
@ -28,7 +29,7 @@ class LibvirtISERVolumeDriver(iscsi.LibvirtISCSIVolumeDriver):
|
|||
# Call the factory here so we can support
|
||||
# more than x86 architectures.
|
||||
self.connector = connector.InitiatorConnector.factory(
|
||||
'ISER', utils.get_root_helper(),
|
||||
initiator.ISER, utils.get_root_helper(),
|
||||
use_multipath=CONF.libvirt.iser_use_multipath,
|
||||
device_scan_attempts=CONF.libvirt.num_iser_scan_tries,
|
||||
transport=self._get_transport())
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
"""Libvirt volume driver for ScaleIO."""
|
||||
|
||||
from os_brick import initiator
|
||||
from os_brick.initiator import connector
|
||||
from oslo_log import log as logging
|
||||
|
||||
|
@ -37,7 +38,7 @@ class LibvirtScaleIOVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):
|
|||
super(LibvirtScaleIOVolumeDriver, self).__init__(host,
|
||||
is_block_dev=False)
|
||||
self.connector = connector.InitiatorConnector.factory(
|
||||
'SCALEIO', utils.get_root_helper(),
|
||||
initiator.SCALEIO, utils.get_root_helper(),
|
||||
device_scan_attempts=CONF.libvirt.num_volume_scan_tries)
|
||||
|
||||
def get_config(self, connection_info, disk_info):
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
"""Libvirt volume driver for HyperScale."""
|
||||
|
||||
from os_brick import initiator
|
||||
from os_brick.initiator import connector
|
||||
from oslo_log import log as logging
|
||||
|
||||
|
@ -36,7 +37,7 @@ class LibvirtHyperScaleVolumeDriver(libvirt_volume.LibvirtVolumeDriver):
|
|||
def __init__(self, connection):
|
||||
super(LibvirtHyperScaleVolumeDriver, self).__init__(connection)
|
||||
self.connector = connector.InitiatorConnector.factory(
|
||||
'VERITAS_HYPERSCALE', utils.get_root_helper())
|
||||
initiator.VERITAS_HYPERSCALE, utils.get_root_helper())
|
||||
|
||||
def connect_volume(self, connection_info, disk_info, instance):
|
||||
# The os-brick connector may raise BrickException.
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
import collections
|
||||
import re
|
||||
|
||||
from os_brick import initiator
|
||||
from os_brick.initiator import connector
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
@ -57,7 +58,7 @@ class LibvirtVZStorageVolumeDriver(fs.LibvirtBaseFileSystemVolumeDriver):
|
|||
# Call the factory here so we can support
|
||||
# more than x86 architectures.
|
||||
self.connector = connector.InitiatorConnector.factory(
|
||||
'vzstorage', utils.get_root_helper(),
|
||||
initiator.VZSTORAGE, utils.get_root_helper(),
|
||||
vzstorage_mount_point_base=CONF.libvirt.vzstorage_mount_point_base)
|
||||
|
||||
def _get_mount_point_base(self):
|
||||
|
|
Loading…
Reference in New Issue