From patchwork Fri Jun 25 13:07:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Owen Hilyard X-Patchwork-Id: 94864 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2A31BA0547; Fri, 25 Jun 2021 15:07:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E859040698; Fri, 25 Jun 2021 15:07:57 +0200 (CEST) Received: from mail-pl1-f228.google.com (mail-pl1-f228.google.com [209.85.214.228]) by mails.dpdk.org (Postfix) with ESMTP id C78804068A for ; Fri, 25 Jun 2021 15:07:56 +0200 (CEST) Received: by mail-pl1-f228.google.com with SMTP id d1so4053136plg.6 for ; Fri, 25 Jun 2021 06:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xDvQNjS8ZqOQgLOrmaU0ucLrqy+6CnpA7WrkN5fPRPQ=; b=eZYjr+bYntagni4+l10i1xY/K6eQMq/MIGMnBoys2zzaUO47cAKjhQpq5eKyJyva9e 6kwxqrZV5IiqWUtfP7Q9F9q6PxaqcdRJtO2Qnm53OHu2csBl/IC++7oADGUKO9m6ssRG rWD4Mqt/+qXrlSrTHWi2CpN2APDXv9trR5Z6U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xDvQNjS8ZqOQgLOrmaU0ucLrqy+6CnpA7WrkN5fPRPQ=; b=JB2XZkwdnQMb2Xl8/OBgbelsX7Ws0nLi1DwdJTYaW0l1a1F2rspH7S+WZN1fbIhvY8 NH5QifyiKEX69lrHlhwWalbniWn9SolM5HD4LKMyNLLNKNoTuv0Wo9vUkQF1U+YQkoXj wM15BabRQx38JyJ/juxr1AM7IBbJQoBO4KgrxI+LDrdfngPsybTQKN+oZxe7DKDknpbr g++vODbo4xDtb5k/dxHlAX5q57l044JVysaXysis0pJLTOut2eT5NdCiPcd16fBr+g5U /Sfn3yRRHImBL5XgsnX02s1zVV/Pp86S1TDrD+Dy2wFzpEfI5RNvtrOw1l0bj3IHL2rx G8eA== X-Gm-Message-State: AOAM532T48IDmVTo+7D3rOrTWK1jNzp/lgxuTDxSLfcB19w7p4umBDJG p0TADxiqbnW5qCSSIttNJlV6FbedTrGaA700E1+unCil9hbH7xqbvfdH+jRqwUzQoxX2UqNguHh liw4rPPHYL4OUbw3rmg0NM8KhLhWR5m9AkODDZOwkOUoCMoECiQoV5dx0/wn5+k+wdvMHYW67Ye jq+oEt0UVLVsN1PQ== X-Google-Smtp-Source: ABdhPJzDIOl1T3s1iODxeP6UdSVX77JRS3iNwsRwpSXfU7IkM0FjHH8eXJOD1KTQWY/0QNKZQXJIWLU2/R2z X-Received: by 2002:a17:90a:fb95:: with SMTP id cp21mr11133065pjb.28.1624626475751; Fri, 25 Jun 2021 06:07:55 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id n7sm4113822pjv.17.2021.06.25.06.07.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jun 2021 06:07:55 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1220:cb5d:c859:780f:37ce]) by postal.iol.unh.edu (Postfix) with ESMTP id 071866052490; Fri, 25 Jun 2021 09:07:55 -0400 (EDT) From: ohilyard@iol.unh.edu To: lijuan.tu@intel.com Cc: dts@dpdk.org, Owen Hilyard Date: Fri, 25 Jun 2021 09:07:52 -0400 Message-Id: <20210625130753.18155-1-ohilyard@iol.unh.edu> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [dts] [PATCH] framework/config: fix issue with string values X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" From: Owen Hilyard String values were ran through 'eval' like everything else as part of parsing config files. This will work the first time if there are quotes around the value, but if the --update-expected flag is passed, it will re-write the config file without quotes around the string value. This then cause an error when the value is 'eval'ed again, since it will now be evaluated as a variable. Signed-off-by: Owen Hilyard --- framework/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/config.py b/framework/config.py index 30604773..88ae8ea5 100644 --- a/framework/config.py +++ b/framework/config.py @@ -147,7 +147,10 @@ class SuiteConf(UserConf): conf = dict(case_confs) for key, data_string in list(conf.items()): - case_cfg[key] = eval(data_string) + try: + case_cfg[key] = eval(data_string) + except NameError: # happens when data_string is actually a string, not an int, bool or dict + case_cfg[key] = data_string return case_cfg