diff options
| author | Simeon Simeonov | 2017-09-05 09:29:11 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2017-09-05 09:29:11 +0200 |
| commit | 4a25a7de7adc2e0884e72a0182b39e1747a7f5e1 (patch) | |
| tree | 1e785967096bd4e2c60c6eebcbc29ae3ac2714b5 | |
| parent | ec97fd91ff30f0298178c736c5e06e8ddeb0fc2d (diff) | |
Make it possible to add mount / ssh options
| -rwxr-xr-x | smount.py | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -21,10 +21,12 @@ def main(): | |||
| 21 | cstm_error = 'Invalid / nonexistent mapping: {0}'.format(sys.argv[1]) | 21 | cstm_error = 'Invalid / nonexistent mapping: {0}'.format(sys.argv[1]) |
| 22 | data = config_dict[sys.argv[1]] | 22 | data = config_dict[sys.argv[1]] |
| 23 | cstm_error = 'system() error' | 23 | cstm_error = 'system() error' |
| 24 | subprocess.check_call(['/usr/bin/sshfs', | 24 | args = ['/usr/bin/sshfs'] |
| 25 | # data.get('options', ''), | 25 | if data.get('options'): |
| 26 | data['src'], | 26 | for opt in data.get('options'): |
| 27 | data['dest']]) | 27 | args.extend(['-o', opt]) |
| 28 | args.extend([data['src'], data['dest']]) | ||
| 29 | subprocess.check_call(args) | ||
| 28 | except subprocess.CalledProcessError as e: | 30 | except subprocess.CalledProcessError as e: |
| 29 | sys.stderr.write('Execution error: {0}\n'.format(e)) | 31 | sys.stderr.write('Execution error: {0}\n'.format(e)) |
| 30 | sys.stderr.flush() | 32 | sys.stderr.flush() |
