[CRIU,1/2] p.haul: minor style improvements in vz module

Submitted by Nikita Spiridonov on May 14, 2016, 2:48 p.m.

Details

Message ID 1463237313-347740-2-git-send-email-nspiridonov@virtuozzo.com
State New
Series "p.haul: create Virtuozzo specific dump images during final dump"
Headers show

Commit Message

Nikita Spiridonov May 14, 2016, 2:48 p.m.
Move __setup_restore_extra_args and __remove_restore_extra_args
functions below final_restore function to improve readability.

Signed-off-by: Nikita Spiridonov <nspiridonov@virtuozzo.com>
---
 phaul/p_haul_vz.py |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

Patch hide | download patch | download mbox

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()

Comments

Pavel Emelyanov May 16, 2016, 6:22 p.m.
Applied