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

[disk] be resilient when dealing with NFS secure mounts #470

Merged
merged 1 commit into from
Oct 4, 2017
Merged
Show file tree
Hide file tree
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
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"
}