[CRIU] [PATCH 1/3] p.haul: minor style changes in p_haul_vz.py

Nikita Spiridonov nspiridonov at odin.com
Thu Nov 26 04:52:17 PST 2015


Rename parse_vz_config and expand_veid_var functions of p_haul_vz.py
(add leading underscore) to make it formally private module
function.

Signed-off-by: Nikita Spiridonov <nspiridonov at odin.com>
---
 phaul/p_haul_vz.py |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
index 70a4620..b9ca5b7 100644
--- a/phaul/p_haul_vz.py
+++ b/phaul/p_haul_vz.py
@@ -36,11 +36,11 @@ class p_haul_type:
 
 		# Read container config
 		with open(self.__ct_config_path(path)) as ifd:
-			config = parse_vz_config(ifd.read())
+			config = _parse_vz_config(ifd.read())
 
 		# Read global config
 		with open(vz_global_conf) as ifd:
-			global_config = parse_vz_config(ifd.read())
+			global_config = _parse_vz_config(ifd.read())
 
 		# Extract veth pairs, later we will equip restore request with this
 		# data and will use it while (un)locking the network
@@ -60,16 +60,16 @@ class p_haul_type:
 
 		# Extract private path from config
 		if "VE_PRIVATE" in config:
-			self._ct_priv = expand_veid_var(config["VE_PRIVATE"], self._ctid)
+			self._ct_priv = _expand_veid_var(config["VE_PRIVATE"], self._ctid)
 		else:
-			self._ct_priv = expand_veid_var(global_config["VE_PRIVATE"],
+			self._ct_priv = _expand_veid_var(global_config["VE_PRIVATE"],
 				self._ctid)
 
 		# Extract root path from config
 		if "VE_ROOT" in config:
-			self._ct_root = expand_veid_var(config["VE_ROOT"], self._ctid)
+			self._ct_root = _expand_veid_var(config["VE_ROOT"], self._ctid)
 		else:
-			self._ct_root = expand_veid_var(global_config["VE_ROOT"],
+			self._ct_root = _expand_veid_var(global_config["VE_ROOT"],
 				self._ctid)
 
 	def __load_ct_config_dst(self, path):
@@ -240,7 +240,7 @@ class p_haul_type:
 		return True
 
 
-def parse_vz_config(body):
+def _parse_vz_config(body):
 	"""Parse shell-like virtuozzo config file"""
 
 	config_values = dict()
@@ -250,6 +250,6 @@ def parse_vz_config(body):
 	return config_values
 
 
-def expand_veid_var(value, ctid):
+def _expand_veid_var(value, ctid):
 	"""Replace shell-like VEID variable with actual container id"""
 	return value.replace("$VEID", ctid).replace("${VEID}", ctid)
-- 
1.7.1



More information about the CRIU mailing list