Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadostin Stoyanov <radostin@redhat.com>2021-09-05 23:34:00 +0300
committerAndrei Vagin <avagin@gmail.com>2022-04-29 03:53:52 +0300
commitc71a81a6bdeb943bbe8311177bbc0001bc5196df (patch)
tree630d9642e3d203103fdd584a4d17e1558cea84b2 /coredump
parentbf8a3c9f62302f73099223de93b6bdd7e2b13a18 (diff)
coredump: convert indentation to spaces
Signed-off-by: Radostin Stoyanov <radostin@redhat.com>
Diffstat (limited to 'coredump')
-rwxr-xr-xcoredump/coredump-python22
-rwxr-xr-xcoredump/coredump-python32
-rwxr-xr-xcoredump/coredump.py58
3 files changed, 32 insertions, 30 deletions
diff --git a/coredump/coredump-python2 b/coredump/coredump-python2
index 3a15c90a3..564c05ce9 100755
--- a/coredump/coredump-python2
+++ b/coredump/coredump-python2
@@ -3,4 +3,4 @@
import coredump
if __name__ == '__main__':
- coredump.main()
+ coredump.main()
diff --git a/coredump/coredump-python3 b/coredump/coredump-python3
index 82ec6b855..3032dbadf 100755
--- a/coredump/coredump-python3
+++ b/coredump/coredump-python3
@@ -3,4 +3,4 @@
import coredump
if __name__ == '__main__':
- coredump.main()
+ coredump.main()
diff --git a/coredump/coredump.py b/coredump/coredump.py
index 56ba54083..e63abf951 100755
--- a/coredump/coredump.py
+++ b/coredump/coredump.py
@@ -3,37 +3,39 @@ import os
import criu_coredump
+
def coredump(opts):
- generator = criu_coredump.coredump_generator()
- cores = generator(os.path.realpath(opts['in']))
- for pid in cores:
- if opts['pid'] and pid != opts['pid']:
- continue
- with open(os.path.realpath(opts['out'])+"/core."+str(pid), 'wb+') as f:
- cores[pid].write(f)
+ generator = criu_coredump.coredump_generator()
+ cores = generator(os.path.realpath(opts['in']))
+ for pid in cores:
+ if opts['pid'] and pid != opts['pid']:
+ continue
+ with open(os.path.realpath(opts['out'])+"/core."+str(pid), 'wb+') as f:
+ cores[pid].write(f)
def main():
- desc = 'CRIU core dump'
- parser = argparse.ArgumentParser(description=desc,
- formatter_class=argparse.RawTextHelpFormatter)
-
- parser.add_argument('-i',
- '--in',
- default = '.',
- help = 'directory where to get images from')
- parser.add_argument('-p',
- '--pid',
- type = int,
- help = 'generate coredump for specific pid(all pids py default)')
- parser.add_argument('-o',
- '--out',
- default = '.',
- help = 'directory to write coredumps to')
-
- opts = vars(parser.parse_args())
-
- coredump(opts)
+ desc = 'CRIU core dump'
+ parser = argparse.ArgumentParser(description=desc,
+ formatter_class=argparse.RawTextHelpFormatter)
+
+ parser.add_argument('-i',
+ '--in',
+ default='.',
+ help='directory where to get images from')
+ parser.add_argument('-p',
+ '--pid',
+ type=int,
+ help='generate coredump for specific pid(all pids py default)')
+ parser.add_argument('-o',
+ '--out',
+ default='.',
+ help='directory to write coredumps to')
+
+ opts = vars(parser.parse_args())
+
+ coredump(opts)
+
if __name__ == '__main__':
- main()
+ main()