summaryrefslogtreecommitdiff
path: root/cmount.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmount.py')
-rwxr-xr-xcmount.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/cmount.py b/cmount.py
index e2dc8bf..2a7f201 100755
--- a/cmount.py
+++ b/cmount.py
@@ -1,4 +1,4 @@
1#!/usr/bin/env python 1#!/usr/bin/env python3
2# -*- coding: utf-8 -*- 2# -*- coding: utf-8 -*-
3 3
4import json 4import json
@@ -9,8 +9,7 @@ import time
9 9
10 10
11def main(): 11def main():
12 """ 12
13 """
14 if (len(sys.argv) != 2): 13 if (len(sys.argv) != 2):
15 sys.exit('Invalid parameter. Usage: {0} <mapping>\n'.format( 14 sys.exit('Invalid parameter. Usage: {0} <mapping>\n'.format(
16 sys.argv[0])) 15 sys.argv[0]))
@@ -63,11 +62,9 @@ def main():
63 arguments.append(data['target']) 62 arguments.append(data['target'])
64 subprocess.check_call(arguments) 63 subprocess.check_call(arguments)
65 except subprocess.CalledProcessError as e: 64 except subprocess.CalledProcessError as e:
66 sys.stderr.write('Execution error: {0}\n'.format(e)) 65 print('Execution error: {0}\n'.format(e), file=sys.stderr, flush=True)
67 sys.stderr.flush() 66 except Exception:
68 except Exception as e: 67 print('Error: {0}\n'.format(cstm_error), file=sys.stderr, flush=True)
69 sys.stderr.write('Error: {0}\n'.format(cstm_error))
70 sys.stderr.flush()
71 68
72 69
73if __name__ == '__main__': 70if __name__ == '__main__':