Libvirt SMB volume driver: fix volume attach

The Libvirt SMB volume driver fails to attach volumes if the
connection info does not contain mount options.

The reason is that the mount options are not parsed correctly.
It attempts to join the connection info mount options (which in
this case are set to None) with the locally configured mount
options.

This patch handles the case when the mount options are set to None.

Change-Id: I3166ef5420409ad45cf64f04e6c1d30b6c674d20
Closes-Bug: #1437389
This commit is contained in:
Lucian Petrut 2015-03-27 18:09:49 +02:00
parent c8caebfcba
commit 872dc5f6af
2 changed files with 3 additions and 2 deletions

View File

@ -1585,7 +1585,8 @@ Setting up iSCSI targets: unused
export_mnt_base = os.path.join(mnt_base,
utils.get_hash_str(export_string))
connection_info = {'data': {'export': export_string,
'name': self.name}}
'name': self.name,
'options': None}}
libvirt_driver.connect_volume(connection_info, self.disk_info)
libvirt_driver.disconnect_volume(connection_info, "vde")

View File

@ -1005,7 +1005,7 @@ class LibvirtSMBFSVolumeDriver(LibvirtBaseVolumeDriver):
def _parse_mount_options(self, connection_info):
mount_options = " ".join(
[connection_info['data'].get('options', ''),
[connection_info['data'].get('options') or '',
CONF.libvirt.smbfs_mount_options])
if not self.username_regex.findall(mount_options):