Skip to content

Commit

Permalink
attempt to be resilient when dealing with NFS secure mounts (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
masci authored and truthbk committed Oct 4, 2017
1 parent 55ce2be commit 60c928f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
7 changes: 7 additions & 0 deletions disk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG - disk

1.0.2 / Unreleased
==================

### Changes

* [BUG] Skip now works with NFS secure mounts too. See #484.

1.0.1 / 2017-07-18
==================

Expand Down
13 changes: 10 additions & 3 deletions disk/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,21 @@ def _exclude_disk_psutil(self, part):
# ENOENT, pop-up a Windows GUI error for a non-ready
# partition or just hang;
# and all the other excluded disks
return ((Platform.is_win32() and ('cdrom' in part.opts or
part.fstype == '')) or
self._exclude_disk(part.device, part.fstype, part.mountpoint))
skip_win = Platform.is_win32() and ('cdrom' in part.opts or part.fstype == '')
return skip_win or self._exclude_disk(part.device, part.fstype, part.mountpoint)

def _exclude_disk(self, name, filesystem, mountpoint):
"""
Return True for disks we don't want or that match regex in the config file
"""
self.log.debug('_exclude_disk: {}, {}, {}'.format(name, filesystem, mountpoint))

# Hack for NFS secure mounts
# Secure mounts might look like this: '/mypath (deleted)', we should
# ignore all the bits not part of the mountpoint name. Take also into
# account a space might be in the mountpoint.
mountpoint = mountpoint.rsplit(' ', 1)[0]

name_empty = not name or name == 'none'

# allow empty names if `all_partitions` is `yes` so we can evaluate mountpoints
Expand Down
2 changes: 1 addition & 1 deletion disk/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"mac_os",
"windows"
],
"version": "1.0.1",
"version": "1.0.2",
"guid": "94588b23-111e-4ed2-a2af-fd6e4caeea04"
}

0 comments on commit 60c928f

Please sign in to comment.