public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Sharan Turlapati <sturlapati@vmware.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] realtime/scripts: Fix indentation error in parser.py
Date: Mon, 29 Mar 2021 11:17:59 -0700	[thread overview]
Message-ID: <20210329181759.4466-1-sturlapati@vmware.com> (raw)

An indentation error in parser.py causes certain blocks
of code to run even before dependent variables are
initialized when the code in this file is imported
by parse-testpi1.py or parse-testpi2.py.

Post running tests like testpi-2 or testpi-4, the
results of these tests are parsed and added to the
logs/ directory. This bug prevents the results of such
tests from being parsed and thus masks the results of
these tests.

Signed-off-by: Sharan Turlapati <sturlapati@vmware.com>
---
 testcases/realtime/scripts/parser.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/testcases/realtime/scripts/parser.py b/testcases/realtime/scripts/parser.py
index 85226deb6..2acbe7d67 100644
--- a/testcases/realtime/scripts/parser.py
+++ b/testcases/realtime/scripts/parser.py
@@ -33,15 +33,15 @@ class Log:
 	def __init__(self,filename):
 		if filename:
 			log_file=filename
-	try:
-		self.__log_file = open(log_file, "r")
-	except IOError as errmsg:
-		sys.exit(errmsg)
+		try:
+			self.__log_file = open(log_file, "r")
+		except IOError as errmsg:
+			sys.exit(errmsg)
 
 	def read(self):
 		for line in self.__log_file.read().split("\n"):
 			yield line
-	self.__log_file.close()
+		self.__log_file.close()
 
 	def eval(self):
 		pass
-- 
2.28.0


             reply	other threads:[~2021-03-29 18:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 18:17 Sharan Turlapati [this message]
2021-04-01  6:35 ` [LTP] [PATCH] realtime/scripts: Fix indentation error in parser.py Petr Vorel
  -- strict thread matches above, loose matches on Subject: below --
2021-03-25 18:21 Sharan Turlapati

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210329181759.4466-1-sturlapati@vmware.com \
    --to=sturlapati@vmware.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox