import yaml
import random
-from distutils.util import strtobool
-
from teuthology.exceptions import ParseError
from teuthology.suite.build_matrix import \
build_matrix, generate_combinations, _get_matrix
from teuthology.suite import util, merge
+from teuthology.util.strtobool import strtobool
def main(args):
try:
import random
import sys
import time
-from distutils.util import strtobool
import teuthology
from teuthology.config import config, YamlConfig
from teuthology.suite.run import Run
from teuthology.suite.util import schedule_fail
+from teuthology.util.strtobool import strtobool
log = logging.getLogger(__name__)
--- /dev/null
+def strtobool(val):
+ """Convert a string representation of truth to true (1) or false (0).
+
+ True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
+ are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
+ 'val' is anything else.
+ """
+ val = val.lower()
+ if val in ('y', 'yes', 't', 'true', 'on', '1'):
+ return 1
+ elif val in ('n', 'no', 'f', 'false', 'off', '0'):
+ return 0
+ else:
+ raise ValueError(f"invalid truth value {val!r}")