Skip to content

Commit

Permalink
CA-210336: Added exception handling to prevent stack trace dump
Browse files Browse the repository at this point in the history
Added a try-except block around line 353 which lists devices
at a given path in BaseISCSI.py attach method

Signed-off-by: Letsibogo Ramadi <[email protected]>
  • Loading branch information
letsboogey committed Aug 16, 2016
1 parent b18f57a commit 5c1552f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/BaseISCSI.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,12 @@ def attach(self, sr_uuid):
if self.dconf.has_key('SCSIid'):
if self.mpath == 'true':
self.mpathmodule.refresh(self.dconf['SCSIid'], 0)
devs = os.listdir("/dev/disk/by-scsid/%s" % self.dconf['SCSIid'])
try:
devs_path = "/dev/disk/by-scsid/%s" % self.dconf['SCSIid']
devs = os.listdir(devs_path)
except:
util.SMlog("[Errno 2] No such file or directory: '%s'" % devs_path)

for dev in devs:
realdev = os.path.realpath("/dev/disk/by-scsid/%s/%s" % (self.dconf['SCSIid'], dev))
util.set_scheduler(realdev.split("/")[-1], "noop")
Expand Down

0 comments on commit 5c1552f

Please sign in to comment.