From c47d6541e0ccb52102248ae7561b013fb87b31ed Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Wed, 26 Jun 2019 06:32:48 +0200 Subject: [PATCH] scripts/rpc.py: rename mock_ functions There will be one more "mocked" implementation soon, so make existing names more descriptive now. Change-Id: I30daf2b60ab683d5befb06eca50d455712858d61 Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459390 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker --- scripts/rpc.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/rpc.py b/scripts/rpc.py index c6697ea20e..0d5744e53c 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1813,11 +1813,11 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse if name in deprecated_aliases: print("{} is deprecated, use {} instead.".format(name, deprecated_aliases[name]), file=sys.stderr) - class mock_client: + class dry_run_client: def call(self, method, params=None): print("Request:\n" + json.dumps({"method": method, "params": params}, indent=2)) - def mock_print(arg): + def null_print(arg): pass def call_rpc_func(args): @@ -1842,10 +1842,10 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse args = parser.parse_args() if args.dry_run: - args.client = mock_client() - print_dict = mock_print - print_json = mock_print - print_array = mock_print + args.client = dry_run_client() + print_dict = null_print + print_json = null_print + print_array = null_print else: args.client = rpc.client.JSONRPCClient(args.server_addr, args.port, args.timeout, log_level=getattr(logging, args.verbose.upper())) if hasattr(args, 'func'):