Skip to content

Commit

Permalink
CA-153517: Fix LVHD SR delete
Browse files Browse the repository at this point in the history
Due to differences in dmsetup version cleanups, this patch takes a safe
approach in the sr delete code-path.

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
  • Loading branch information
siddharthv committed Dec 5, 2014
1 parent a11482a commit e45ecea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/LVHDSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,9 @@ def delete(self, uuid):
try:
lvname = os.path.basename(fileName.replace('-','/').\
replace('//', '-'))
os.unlink(os.path.join(self.path, lvname))
lpath = os.path.join(self.path, lvname)
if os.path.lexists(lpath):
os.unlink(lpath)
except Exception, e:
util.SMlog("LVHDSR.delete: failed to remove the symlink for " \
"file %s. Error: %s" % (fileName, str(e)))
Expand Down

0 comments on commit e45ecea

Please sign in to comment.