Skip to content

Commit

Permalink
format with balck
Browse files Browse the repository at this point in the history
  • Loading branch information
riya-17 committed Jun 28, 2024
1 parent d60c146 commit dc802a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions opl/cluster_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ def measure(
"""
Execute command "command" and return result as per its "output" configuration
"""
name = config['name']
log_source_command = config['log_source_command']
name = config["name"]
log_source_command = config["log_source_command"]
result = execute(log_source_command).splitlines()

output = {}
Expand All @@ -396,12 +396,12 @@ def measure(
for pattern_name, pattern_value in config.items():
if not pattern_name.startswith("log_regexp_"):
continue
pattern_key = pattern_name[len("log_regexp_"):]
pattern_key = pattern_name[len("log_regexp_") :]
pattern_regexp = re.compile(pattern_value)
counter = 0
for line in result:
if pattern_regexp.search(line):
counter+=1
counter += 1
output[pattern_key] = counter

return name, output
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cluster_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_count(self):
k, v = next(ri)
self.assertEqual(k, "print.output")
self.assertEqual(v, {"all": 4, "error": 1, "warning": 1})

def test_count_large(self):
string = """
- name: print.output
Expand Down

0 comments on commit dc802a8

Please sign in to comment.