[CRIU] [PATCH p.haul 1/2] p.haul: minor style improvements in vz module
Nikita Spiridonov
nspiridonov at virtuozzo.com
Sat May 14 07:48:32 PDT 2016
Move __setup_restore_extra_args and __remove_restore_extra_args
functions below final_restore function to improve readability.
Signed-off-by: Nikita Spiridonov <nspiridonov at virtuozzo.com>
---
phaul/p_haul_vz.py | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
index 8f33a17..602bd57 100644
--- a/phaul/p_haul_vz.py
+++ b/phaul/p_haul_vz.py
@@ -149,20 +149,6 @@ class p_haul_type:
def put_meta_images(self, path):
pass
- def __setup_restore_extra_args(self, path, img, connection):
- """Create temporary file with extra arguments for criu restore"""
- extra_args = [
- "VE_WORK_DIR={0}\n".format(img.work_dir()),
- "VE_RESTORE_LOG_PATH={0}\n".format(
- connection.get_log_name(pycriu.rpc.RESTORE))]
- with open(path, "w") as f:
- f.writelines(extra_args)
-
- def __remove_restore_extra_args(self, path):
- """Remove temporary file with extra arguments for criu restore"""
- if os.path.isfile(path):
- os.remove(path)
-
def final_dump(self, pid, img, ccon, fs):
criu_cr.criu_dump(self, pid, img, ccon, fs)
@@ -185,6 +171,20 @@ class p_haul_type:
# Remove restore extra arguments
self.__remove_restore_extra_args(args_path)
+ def __setup_restore_extra_args(self, path, img, connection):
+ """Create temporary file with extra arguments for criu restore"""
+ extra_args = [
+ "VE_WORK_DIR={0}\n".format(img.work_dir()),
+ "VE_RESTORE_LOG_PATH={0}\n".format(
+ connection.get_log_name(pycriu.rpc.RESTORE))]
+ with open(path, "w") as f:
+ f.writelines(extra_args)
+
+ def __remove_restore_extra_args(self, path):
+ """Remove temporary file with extra arguments for criu restore"""
+ if os.path.isfile(path):
+ os.remove(path)
+
def prepare_ct(self, pid):
"""Create cgroup hierarchy and put root task into it."""
self.__cg_set_veid()
--
1.7.1
More information about the CRIU
mailing list