From 4a25a7de7adc2e0884e72a0182b39e1747a7f5e1 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Tue, 5 Sep 2017 09:29:11 +0200 Subject: Make it possible to add mount / ssh options --- smount.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'smount.py') diff --git a/smount.py b/smount.py index 9a611d7..28b9ec0 100755 --- a/smount.py +++ b/smount.py @@ -21,10 +21,12 @@ def main(): cstm_error = 'Invalid / nonexistent mapping: {0}'.format(sys.argv[1]) data = config_dict[sys.argv[1]] cstm_error = 'system() error' - subprocess.check_call(['/usr/bin/sshfs', - # data.get('options', ''), - data['src'], - data['dest']]) + args = ['/usr/bin/sshfs'] + if data.get('options'): + for opt in data.get('options'): + args.extend(['-o', opt]) + args.extend([data['src'], data['dest']]) + subprocess.check_call(args) except subprocess.CalledProcessError as e: sys.stderr.write('Execution error: {0}\n'.format(e)) sys.stderr.flush() -- cgit v1.3