Skip to content

Commit

Permalink
Merge pull request #1157 from tatokis/mount-exception-fix
Browse files Browse the repository at this point in the history
Fix FileNotFoundError exception in mount.mounted
  • Loading branch information
Germar authored Jul 4, 2021
2 parents 25293c8 + b75dd64 commit 1511422
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions common/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,11 @@ def mounted(self):
if os.path.ismount(self.currentMountpoint):
return True
else:
if os.listdir(self.currentMountpoint):
raise MountException(_('mountpoint %s not empty.') % self.currentMountpoint)
try:
if os.listdir(self.currentMountpoint):
raise MountException(_('mountpoint %s not empty.') % self.currentMountpoint)
except FileNotFoundError:
pass
return False

def createMountStructure(self):
Expand Down

0 comments on commit 1511422

Please sign in to comment.