Skip to content

Commit

Permalink
Unity: fix host_luns issue (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
yong-huang authored Jan 28, 2022
1 parent 6c9ed0b commit 2a66963
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storops/unity/resource/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ def _attach_with_retry(self, lun_or_snap, skip_hlu_0):

# If the same lun/snap attach to the same host, return the existed hlu
self.update()
if is_lun:
if self.host_luns and is_lun:
host_luns = [x for x in self.host_luns if not x.snap]
for host_lun in host_luns:
if lun_or_snap.id == host_lun.lun.id:
return host_lun.hlu
else:
if self.host_luns and not is_lun:
host_snaps = [x for x in self.host_luns if x.snap]
for host_snap in host_snaps:
if lun_or_snap.id == host_snap.snap.id:
Expand Down

0 comments on commit 2a66963

Please sign in to comment.