From 8ef2a7f12227a6d3365ac77040d14becba6ddd83 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Thu, 14 Sep 2017 19:56:17 +0200 Subject: Enable / disable VG as well --- cmount.py | 6 ++++++ cumount.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/cmount.py b/cmount.py index f980dc9..9e25bda 100755 --- a/cmount.py +++ b/cmount.py @@ -5,6 +5,7 @@ import json import os import subprocess import sys +import time def main(): @@ -30,7 +31,12 @@ def main(): 'luksOpen', device, mapper_name]) + time.sleep(3) cstm_error = 'lvchange error' + subprocess.check_call(['/sbin/vgchange', + '-a', + 'y', + data['device'].split('/')[2]]) subprocess.check_call(['/sbin/lvchange', '-a', 'y', diff --git a/cumount.py b/cumount.py index e2fb32f..e74bc00 100755 --- a/cumount.py +++ b/cumount.py @@ -32,6 +32,10 @@ def main(): '-a', 'n', data['device']]) + subprocess.check_call(['/sbin/vgchange', + '-a', + 'n', + data['device'].split('/')[2]]) cstm_error = 'pv_sources error' for mapper_name in data['pv_sources'].values(): subprocess.check_call(['/sbin/cryptsetup', -- cgit v1.3