Skip to content

Commit d62ce27

Browse files
committed
util: remove unnecessary var
Signed-off-by: Vitor Bandeira <[email protected]>
1 parent 560af1d commit d62ce27

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

flow/util/genMetrics.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,8 @@ def extractTagFromFile(
8282
if jsonTag in jsonFile:
8383
print("[WARN] Overwriting Tag", jsonTag)
8484

85-
# Open file
8685
try:
87-
searchFilePath = file
88-
with open(searchFilePath) as f:
86+
with open(file) as f:
8987
content = f.read()
9088

9189
parsedMetrics = re.findall(pattern, content, re.M)
@@ -110,12 +108,12 @@ def extractTagFromFile(
110108
else:
111109
# Only print a warning if the defaultNotFound is not set
112110
print(
113-
"[WARN] Tag {} not found in {}.".format(jsonTag, searchFilePath),
111+
"[WARN] Tag {} not found in {}.".format(jsonTag, file),
114112
"Will use {}.".format(defaultNotFound),
115113
)
116114
jsonFile[jsonTag] = defaultNotFound
117115
except IOError:
118-
print("[ERROR] Failed to open file:", searchFilePath)
116+
print("[ERROR] Failed to open file:", file)
119117
jsonFile[jsonTag] = "ERR"
120118

121119

0 commit comments

Comments
 (0)