Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [15:02 xen1 ~]# diff /opt/xensource/sm/LVHDoISCSISR.py /mnt/backup-xs-7.1/opt/xensource/sm/LVHDoISCSISR.py
- 21,23c21,23
- < import SR, LVHDSR, BaseISCSI, SRCommand, util, scsiutil, lvutil
- < import time
- < import os, sys
- ---
- > import SR, VDI, LVHDSR, BaseISCSI, SRCommand, util, scsiutil, lvutil
- > import statvfs, time
- > import os, socket, sys, re
- 27a28
- > import mpp_luncheck
- 35,36c36
- < "VDI_UPDATE", "VDI_MIRROR", "VDI_CONFIG_CBT",
- < "VDI_ACTIVATE", "VDI_DEACTIVATE"]
- ---
- > "VDI_UPDATE", "VDI_MIRROR"]
- 90d89
- < saved_exc = None
- 158c157
- < except Exception as exc:
- ---
- > except:
- 160,169c159
- < saved_exc = exc
- < try:
- < self.iscsi = self.iscsiSRs[0]
- < except IndexError as exc:
- < if isinstance(saved_exc, SR.SROSError):
- < raise saved_exc # pylint: disable-msg=E0702
- < elif isinstance(saved_exc, Exception):
- < raise xs_errors.XenError('SMGeneral', str(saved_exc))
- < else:
- < raise xs_errors.XenError('SMGeneral', str(exc))
- ---
- > self.iscsi = self.iscsiSRs[0]
- 398a389,393
- > mpp_lun = False
- > if (mpp_luncheck.is_RdacLun(scsi_id)):
- > mpp_lun = True
- > link=glob.glob('/dev/disk/by-scsibus/%s-*' % scsi_id)
- > mpp_adapter = link[0].split('/')[-1].split('-')[-1].split(':')[0]
- 403a399,400
- > if mpp_lun:
- > sgdevs.extend(filter(lambda r: r[1]==mpp_adapter, luns))
- 520,528d516
- < def scan(self, sr_uuid):
- < if self.mpath == "true":
- < for i in self.iscsiSRs:
- < try:
- < i.attach(sr_uuid)
- < except SR.SROSError:
- < util.SMlog("Connection failed for target %s, continuing.." %i.target)
- < LVHDSR.LVHDSR.scan(self, sr_uuid)
- <
- 536a525
- > mpp_lun = False
- 538c527,531
- < maps = mpath_cli.list_maps()
- ---
- > if (mpp_luncheck.is_RdacLun(self.dconf['SCSIid'])):
- > mpp_lun = True
- > link=glob.glob('/dev/disk/mpInuse/%s-*' % self.dconf['SCSIid'])
- > else:
- > maps = mpath_cli.list_maps()
- 542,543c535,540
- < if self.dconf['SCSIid'] in maps:
- < raise xs_errors.XenError('SRInUse')
- ---
- > if (mpp_lun):
- > if (len(link)):
- > raise xs_errors.XenError('SRInUse')
- > else:
- > if self.dconf['SCSIid'] in maps:
- > raise xs_errors.XenError('SRInUse')
Advertisement
Add Comment
Please, Sign In to add comment