[CRIU] [PATCH 05/10] p.haul: remove aliases for modules during import
Nikita Spiridonov
nspiridonov at odin.com
Fri Oct 9 10:11:37 PDT 2015
Remove aliases for modules during import in p.haul and
p.haul-service. That ph_iters, ph_images and so on confusing
and hard to understand when used non systematical.
Signed-off-by: Nikita Spiridonov <nspiridonov at odin.com>
---
p.haul | 12 ++++++------
p.haul-service | 7 ++++---
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/p.haul b/p.haul
index 5f7b723..c828a26 100755
--- a/p.haul
+++ b/p.haul
@@ -3,10 +3,10 @@
import sys
import argparse
import logging
-import phaul.p_haul_iters as ph_iters
-import phaul.images as ph_images
-import phaul.criu_api as ph_criu_api
+import phaul.p_haul_iters
import phaul.p_haul_connection
+import phaul.images
+import phaul.criu_api
# Usage idea
# p.haul <type> <id> --fdrpc <fd> --fdmem <fd> --fdfs <fd>
@@ -29,11 +29,11 @@ parser.add_argument("--to", help="IP where to haul")
parser.add_argument("--fdrpc", help="File descriptor of rpc socket", type=int, required=True)
parser.add_argument("--fdmem", help="File descriptor of memory socket", type=int, required=True)
parser.add_argument("--fdfs", help="File descriptor of fs socket", type=int, required=True)
-parser.add_argument("-v", help="Verbosity level", default=ph_criu_api.def_verb, type=int, dest="verbose")
+parser.add_argument("-v", help="Verbosity level", default=phaul.criu_api.def_verb, type=int, dest="verbose")
parser.add_argument("--keep-images", help="Keep images after migration", default=False, action='store_true')
parser.add_argument("--dst-rpid", help="Write pidfile on restore", default=None)
parser.add_argument("--img-path", help="Directory where to put images",
- default=ph_images.def_path)
+ default=phaul.images.def_path)
parser.add_argument("--pid-root", help="Path to tree's FS root")
parser.add_argument("--force", help="Don't do any sanity (CPU compat) checks", default=False, action='store_true')
parser.add_argument("--log-file", help="Write logging messages to specified file")
@@ -59,7 +59,7 @@ connection = phaul.p_haul_connection.establish(args.fdrpc, args.fdmem,
# Start the migration
ph_type = args.type, args.id
-worker = ph_iters.phaul_iter_worker(ph_type, connection)
+worker = phaul.p_haul_iters.phaul_iter_worker(ph_type, connection)
worker.set_options(vars(args))
worker.start_migration()
diff --git a/p.haul-service b/p.haul-service
index 5d0a9e8..ad899d5 100755
--- a/p.haul-service
+++ b/p.haul-service
@@ -4,8 +4,8 @@ import sys
import signal
import argparse
import logging
-import phaul.xem_rpc as ph_xem_rpc
-import phaul.p_haul_service as ph_srv
+import phaul.xem_rpc
+import phaul.p_haul_service
import phaul.p_haul_connection
parser = argparse.ArgumentParser("Process HAULer service server")
@@ -36,7 +36,8 @@ logging.info("Starting p.haul service")
connection = phaul.p_haul_connection.establish(args.fdrpc, args.fdmem,
args.fdfs)
-t = ph_xem_rpc.rpc_threaded_srv(ph_srv.phaul_service, connection)
+t = phaul.xem_rpc.rpc_threaded_srv(phaul.p_haul_service.phaul_service,
+ connection)
# FIXME: Setup stop handlers
sfd = t.get_stop_fd()
--
1.7.1
More information about the CRIU
mailing list