From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 214A2A0032; Wed, 11 May 2022 08:14:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14465410F2; Wed, 11 May 2022 08:14:27 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id D9DA940042 for ; Wed, 11 May 2022 08:14:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652249666; x=1683785666; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=QBjZshhhejVInXaJQZ7UhGNIc66LtKF95Amskf8uuNM=; b=LU7eZhP/Bm5ZIqjcns0JOCVr0CtYANRvb//xUAYUDPpoZjEdw0F/SUdX GoMNVBgrfNv3cZB0xRZB7rNius0yxYSogFQ/9mhpMBYuWKh+KU2+VtNu4 KvmTw8Zrs2Ol3oot9IuZgSGKI5JD/cjck311R0qQ9s3QV0ATyVIFxyd7L 3wjLN4DwI7ZOq54TFGg2xzhBSVbYzPlBJYWBlB+GPi3m0VsDq97uGkCE6 XXAS4OwjffTxBn4DKpA9RAAslDRrrDGTD1uqbhr11UfYFBdDcgLLDLkZT 0jI8VESVXUBJLIsJXB6kx/xRwcV13Z2a255Hmui136X0kcWkfIjAGL8to g==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257139802" X-IronPort-AV: E=Sophos;i="5.91,216,1647327600"; d="scan'208";a="257139802" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 23:14:24 -0700 X-IronPort-AV: E=Sophos;i="5.91,216,1647327600"; d="scan'208";a="623800375" Received: from shwdenpg197.ccr.corp.intel.com ([10.253.109.70]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 23:14:22 -0700 From: Jun Dong To: dts@dpdk.org Cc: lijuan.tu@intel.com, qingx.sun@intel.com, junx.dong@intel.com Subject: [dts] [V1] ixia_network/ixnet: fix bug of changing string content Date: Wed, 11 May 2022 14:14:15 +0800 Message-Id: <20220511061415.3665-1-junx.dong@intel.com> X-Mailer: git-send-email 2.33.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 In history patch that add OUTPUT_DIR variable into initional function to fix E1101 error that instance has no member error[pylint checking]. this intruduce a bug, OUTPUT_DIR was defined in subclass as a property contained a string , and when parent class initial, the OUTPUT_DIR attribute was already exist and couldn't redefine again. this patch attempt to fix it that through reflection mechanism to get the value instead of using the variable directly and to avoid the E1101 error. Signed-off-by: Jun Dong --- framework/ixia_network/ixnet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/ixia_network/ixnet.py b/framework/ixia_network/ixnet.py index 08aaf568..5d54fa30 100644 --- a/framework/ixia_network/ixnet.py +++ b/framework/ixia_network/ixnet.py @@ -70,7 +70,6 @@ class IxnetTrafficGenerator(object): # initialize ixNetwork self.new_blank_config() self.tg_vports = self.assign_ports(self.tg_ports) - self.OUTPUT_DIR = None def get_session_id(self, api_server): url = "{server}/api/v1/sessions".format(server=api_server) @@ -746,7 +745,10 @@ class IxnetTrafficGenerator(object): timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") copy_to_path = os.sep.join( - [self.OUTPUT_DIR, "ixnet" + datetime.now().strftime("%Y%m%d_%H%M%S")] + [ + getattr(self, "OUTPUT_DIR"), + "ixnet" + datetime.now().strftime("%Y%m%d_%H%M%S"), + ] ) if not os.path.exists(copy_to_path): os.makedirs(copy_to_path) -- 2.33.1.windows.1