summaryrefslogtreecommitdiff
path: root/cumount.py
diff options
context:
space:
mode:
Diffstat (limited to 'cumount.py')
-rwxr-xr-xcumount.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/cumount.py b/cumount.py
index ad9f681..16aa2f3 100755
--- a/cumount.py
+++ b/cumount.py
@@ -25,6 +25,15 @@ def main():
25 subprocess.check_call(['/sbin/cryptsetup', 25 subprocess.check_call(['/sbin/cryptsetup',
26 'luksClose', 26 'luksClose',
27 data['mapper_name']]) 27 data['mapper_name']])
28 if data.get('type') == 'efile':
29 cstm_error = 'Unable to destroy loop device'
30 loop_device = subprocess.check_output(['/usr/sbin/losetup',
31 '--associated',
32 data['device']])
33 loop_device = loop_device.split(':')[0]
34 subprocess.check_call(['/usr/sbin/losetup',
35 '-d',
36 loop_device])
28 except subprocess.CalledProcessError as e: 37 except subprocess.CalledProcessError as e:
29 sys.stderr.write('Execution error: {0}\n'.format(e)) 38 sys.stderr.write('Execution error: {0}\n'.format(e))
30 sys.stderr.flush() 39 sys.stderr.flush()