Signed-off-by: Greg Farnum <greg@inktank.com>
remote.run(
args=[
'sudo',
- 'lsof', '-V',
+ 'lsof', '-V', '+D',
'{mnt}'.format(mnt=mnt),
],
check_status=False
for id_, remote in clients:
log.debug('Unmounting nfs client client.{id}...'.format(id=id_))
mnt = os.path.join(testdir, 'mnt.{id}'.format(id=id_))
- remote.run(
- args=[
- 'sudo',
- 'umount',
- mnt,
- ],
- )
- remote.run(
- args=[
- 'rmdir',
- '--',
- mnt,
- ],
- )
+ try:
+ remote.run(
+ args=[
+ 'sudo',
+ 'lsof', '-V', '+D',
+ '{mnt}'.format(mnt=mnt),
+ ],
+ check_status=False
+ )
+ finally:
+ remote.run(
+ args=[
+ 'sudo',
+ 'umount',
+ mnt,
+ ],
+ )
+ remote.run(
+ args=[
+ 'rmdir',
+ '--',
+ mnt,
+ ],
+ )