Skip to content

Commit 1666714

Browse files
committed
1 parent abab42d commit 1666714

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

agent/bench-scripts/templates/make-fio-jobfile.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def replace_all(dct, old, new):
3838
if isinstance(dct[k], dict):
3939
dct[k] = replace_all(dct[k], old, new)
4040
elif dct[k] is not None:
41+
assert isinstance(dct[k], str)
4142
old_val = dct[k]
4243
del dct[k]
4344
k = k.replace(old, new)
@@ -51,9 +52,10 @@ def replace_val(dct, magic, delta):
5152
keys = list(dct.keys())
5253
for k in keys:
5354
if isinstance(dct[k], dict):
54-
dct[k] = replace_val(dct[k], delta)
55-
else:
56-
if (dct[k] is not None) and magic in dct[k]:
55+
dct[k] = replace_val(dct[k], magic, delta)
56+
elif dct[k] is not None:
57+
assert isinstance(dct[k], str)
58+
if magic in dct[k]:
5759
dct[k] = dct[k].replace(magic, delta[k])
5860

5961

contrib/agent/bench-scripts/pbench-bzt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class OSType:
5858
elif attr == "unknown":
5959
return "unknown"
6060
else:
61-
raise (AttributeError, attr)
61+
raise AttributeError(attr)
6262

6363
def platform_type(self):
6464
if platform.dist()[0] == self.rhel:

lib/pbench/server/indexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def __init__(self, basepath, idx_prefix, logger, known_tool_handlers=None, _dbg=
235235
toolname = m.group("toolname")
236236
if self.known_tool_handlers is not None:
237237
if toolname not in self.known_tool_handlers:
238-
MappingFileError(
238+
raise MappingFileError(
239239
"Unsupported tool '{}' mapping file {}".format(
240240
toolname, mapping_fn
241241
)

0 commit comments

Comments
 (0)