summaryrefslogtreecommitdiff
path: root/cumount.py
diff options
context:
space:
mode:
authorSimeon Simeonov2018-09-12 22:17:45 +0200
committerSimeon Simeonov2018-09-12 22:17:45 +0200
commit4c177e6eb71ab2b068f6426b9d141be47fc1f667 (patch)
treecfa1e2ff0f8027a2cfeb8bccd2970b84fec31920 /cumount.py
parentf94c7dc1f3deb93f8efd3a02084ad17bad069280 (diff)
Python2 -> Python3
Diffstat (limited to 'cumount.py')
-rwxr-xr-xcumount.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/cumount.py b/cumount.py
index 565c3fb..0813397 100755
--- a/cumount.py
+++ b/cumount.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
@@ -8,8 +8,7 @@ import sys
8 8
9 9
10def main(): 10def main():
11 """ 11
12 """
13 if (len(sys.argv) != 2): 12 if (len(sys.argv) != 2):
14 sys.exit('Invalid parameter. Usage: {0} <mapping>\n'.format( 13 sys.exit('Invalid parameter. Usage: {0} <mapping>\n'.format(
15 sys.argv[0])) 14 sys.argv[0]))
@@ -56,11 +55,9 @@ def main():
56 '-d', 55 '-d',
57 loop_device]) 56 loop_device])
58 except subprocess.CalledProcessError as e: 57 except subprocess.CalledProcessError as e:
59 sys.stderr.write('Execution error: {0}\n'.format(e)) 58 print('Execution error: {0}\n'.format(e), file=sys.stderr, flush=True)
60 sys.stderr.flush() 59 except Exception:
61 except Exception as e: 60 print('Error: {0}\n'.format(cstm_error), file=sys.stderr, flush=True)
62 sys.stderr.write('Error: {0}\n'.format(cstm_error))
63 sys.stderr.flush()
64 61
65 62
66if __name__ == '__main__': 63if __name__ == '__main__':