Skip to content

Commit 2a66963

Browse files
authored
Unity: fix host_luns issue (#356)
1 parent 6c9ed0b commit 2a66963

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

storops/unity/resource/host.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ def _attach_with_retry(self, lun_or_snap, skip_hlu_0):
264264

265265
# If the same lun/snap attach to the same host, return the existed hlu
266266
self.update()
267-
if is_lun:
267+
if self.host_luns and is_lun:
268268
host_luns = [x for x in self.host_luns if not x.snap]
269269
for host_lun in host_luns:
270270
if lun_or_snap.id == host_lun.lun.id:
271271
return host_lun.hlu
272-
else:
272+
if self.host_luns and not is_lun:
273273
host_snaps = [x for x in self.host_luns if x.snap]
274274
for host_snap in host_snaps:
275275
if lun_or_snap.id == host_snap.snap.id:

0 commit comments

Comments
 (0)