Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA-142451: Fail to report all LUNs advertised on targets sharing the sam... #207

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions drivers/ISCSISR.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,16 @@ def _initPaths(self):
util.SMlog("PATHDICT: key %s: %s" % (key,rec))
addrlist.append(key)

# Try to detect an active path in order of priority
for key in self.pathdict:
if self.adapter.has_key(key):
self.tgtidx = key
self.path = self.pathdict[self.tgtidx]['path']
if os.path.exists(self.path):
util.SMlog("Path found: %s" % self.path)
break
self.address = self.tgtidx
if not os.path.exists(self.path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move this functionality to a separate method, so that we could cover it with unit tests? What I am thinking about:

  • commit 1 to apply a refactor - a simple extract method
  • commit 2 to add Unit Tests for the existing functionality
  • commit 3 to cover the new functionality.

What do you think?

# Try to detect an active path in order of priority
for key in self.pathdict:
if self.adapter.has_key(key):
self.tgtidx = key
self.path = self.pathdict[self.tgtidx]['path']
if os.path.exists(self.path):
util.SMlog("Path found: %s" % self.path)
break
self.address = self.tgtidx
self._synchroniseAddrList(addrlist)

def _init_adapters(self):
Expand Down