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

checking for presence of mountspec.mountpoint to prevent error #273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion aminator/plugins/distro/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def _unmount(self, mountspec):
if open_files.success:
err = '{0}. Device has open files:\n{1}'.format(err, open_files.result.std_out)
raise VolumeException(err)
log.debug('Unmounted {0.mountpoint}'.format(mountspec))
if hasattr(mountspec, 'mountpoint'):
log.debug('Unmounted {0.mountpoint}'.format(mountspec))

@fails("aminator.distro.linux.configure_chroot.error")
@timer("aminator.distro.linux.configure_chroot.duration")
Expand Down
3 changes: 3 additions & 0 deletions aminator/util/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ def handle_sigalarm(*_):


def mounted(mountspec):
if not hasattr(mountspec, 'mountpoint'):
return False

pat = mountspec.mountpoint.strip() + ' '
with open('/proc/mounts') as mounts:
return any(pat in mount for mount in mounts)
Expand Down