From 768c446ff67a39baefb7e81bca63560460c408da Mon Sep 17 00:00:00 2001 From: v1k1nghawk Date: Sat, 11 Feb 2023 01:18:24 +0100 Subject: [PATCH] Fix joint setting of '--reset' and '--no-load' args --- pytpcc/coordinator.py | 4 ++++ pytpcc/tpcc.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/pytpcc/coordinator.py b/pytpcc/coordinator.py index 499b85f..7fcec94 100755 --- a/pytpcc/coordinator.py +++ b/pytpcc/coordinator.py @@ -146,6 +146,10 @@ def startExecution(scaleParameters, args, config,channels): if args['debug']: logging.getLogger().setLevel(logging.DEBUG) + ## Arguments validation + assert args['reset'] == False or args['no_load'] == False, \ + "'--reset' and '--no-load' are incompatible with each other" + ## Create a handle to the target client driver driverClass = createDriverClass(args['system']) assert driverClass != None, "Failed to find '%s' class" % args['system'] diff --git a/pytpcc/tpcc.py b/pytpcc/tpcc.py index 8cc6900..8b631d3 100755 --- a/pytpcc/tpcc.py +++ b/pytpcc/tpcc.py @@ -214,6 +214,10 @@ def executorFunc(driverClass, scaleParameters, args, config, debug): if args['debug']: logging.getLogger().setLevel(logging.DEBUG) + ## Arguments validation + assert args['reset'] == False or args['no_load'] == False, \ + "'--reset' and '--no-load' are incompatible with each other" + ## Create a handle to the target client driver driverClass = createDriverClass(args['system']) assert driverClass != None, "Failed to find '%s' class" % args['system']